Class ListViewHelper
java.lang.Object
de.hybris.platform.cockpit.model.listview.ListViewHelper
Helper class with convenience methods for dealing with list views in a Cockpit application.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceResponsible for registering/unregistering listeners used by a list view.static classHolds list view creation information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcellChanged(UIListView view, int colIndex, int rowIndex, Object eventSource) static ListViewConfigurationgetListViewConfiguration(ObjectTemplate objectTemplate, String contextCode) static booleanstatic <E extends TypedObject>
ListViewHelper.ListViewInfoloadListView(UIListView listView, String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx) Convenience method for loading a list view component.static <E extends TypedObject>
ListViewHelper.ListViewInfoloadListView(UIListView listView, String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx, ListViewConfiguration listViewConf) Convenience method for loading a list view component.
-
Constructor Details
-
ListViewHelper
public ListViewHelper()
-
-
Method Details
-
cellChanged
public static void cellChanged(UIListView view, int colIndex, int rowIndex, Object eventSource) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
loadListView
public static <E extends TypedObject> ListViewHelper.ListViewInfo loadListView(UIListView listView, String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx) throws IllegalArgumentException, IllegalStateException Convenience method for loading a list view component. Contains logic for determining if a new list view UI configuration needs to be loaded and if so creates the related components. Note: The specifiedListViewHelper.ListenerHandlerlistenerHandlerwill only be invoked if a newUIListViewinstance has been created or if a new UI configuration was loaded.- Type Parameters:
E- type of elements which the list view contains- Parameters:
listView- the current list view instancecontextCode- cockpit UI configuration context codeoldRootType- last root typenewRootType- current root typetableModel- the table model (must have a valid list component model set)listModel- the list model which actually holds the items to be displayed in the list view - can benullcockpitListComp- theCockpitListComponentcontaining the actual itemslistenerHandler- theListViewHelper.ListenerHandlerresponsible for registering/unregistering listeners, controllers etcdndCtx- the drag and drop context- Returns:
- a
ListViewHelper.ListViewInfoinstance containing the resultingUIListViewinstance and some additional information - Throws:
IllegalArgumentException- if eithercontextCode,newRootType,itemLoaderortableModel(or its internal list component model) is nullIllegalStateException- if no UI component configuration could be loaded for the typenewRootTypeand the context codecontextCode- See Also:
-
loadListView
public static <E extends TypedObject> ListViewHelper.ListViewInfo loadListView(UIListView listView, String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx, ListViewConfiguration listViewConf) throws IllegalArgumentException, IllegalStateException Convenience method for loading a list view component. Contains logic for determining if a new list view UI configuration needs to be loaded and if so creates the related components. Note: The specifiedListViewHelper.ListenerHandlerlistenerHandlerwill only be invoked if a newUIListViewinstance has been created or if a new UI configuration was loaded.- Type Parameters:
E- type of elements which the list view contains- Parameters:
listView- the current list view instancecontextCode- cockpit UI configuration context codeoldRootType- last root typenewRootType- current root typetableModel- the table model (must have a valid list component model set)listModel- the list model which actually holds the items to be displayed in the list view - can benullcockpitListComp- theCockpitListComponentcontaining the actual itemslistenerHandler- theListViewHelper.ListenerHandlerresponsible for registering/unregistering listeners, controllers etcdndCtx- the drag and drop contextlistViewConf- the alternative configuration of list view, if null then default list view is created according to rest of given parameters- Returns:
- a
ListViewHelper.ListViewInfoinstance containing the resultingUIListViewinstance and some additional information - Throws:
IllegalArgumentException- if eithercontextCode,newRootType,itemLoaderortableModel(or its internal list component model) is nullIllegalStateException- if no UI component configuration could be loaded for the typenewRootTypeand the context codecontextCode- See Also:
-
isForceFireEvent
public static boolean isForceFireEvent() -
getListViewConfiguration
public static ListViewConfiguration getListViewConfiguration(ObjectTemplate objectTemplate, String contextCode)
-