Class ListViewHelper
- java.lang.Object
-
- de.hybris.platform.cockpit.model.listview.ListViewHelper
-
public class ListViewHelper extends java.lang.Object
Helper class with convenience methods for dealing with list views in a Cockpit application.- See Also:
UIListView
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ListViewHelper.ListenerHandler
Responsible for registering/unregistering listeners used by a list view.static class
ListViewHelper.ListViewInfo
Holds list view creation information.
-
Constructor Summary
Constructors Constructor Description ListViewHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
cellChanged(UIListView view, int colIndex, int rowIndex, java.lang.Object eventSource)
static ListViewConfiguration
getListViewConfiguration(ObjectTemplate objectTemplate, java.lang.String contextCode)
static boolean
isForceFireEvent()
static <E extends TypedObject>
ListViewHelper.ListViewInfoloadListView(UIListView listView, java.lang.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, java.lang.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.
-
-
-
Method Detail
-
cellChanged
public static void cellChanged(UIListView view, int colIndex, int rowIndex, java.lang.Object eventSource) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
loadListView
public static <E extends TypedObject> ListViewHelper.ListViewInfo loadListView(UIListView listView, java.lang.String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx) throws java.lang.IllegalArgumentException, java.lang.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.ListenerHandler
listenerHandler
will only be invoked if a newUIListView
instance 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 benull
cockpitListComp
- theCockpitListComponent
containing the actual itemslistenerHandler
- theListViewHelper.ListenerHandler
responsible for registering/unregistering listeners, controllers etcdndCtx
- the drag and drop context- Returns:
- a
ListViewHelper.ListViewInfo
instance containing the resultingUIListView
instance and some additional information - Throws:
java.lang.IllegalArgumentException
- if eithercontextCode
,newRootType
,itemLoader
ortableModel
(or its internal list component model) is nulljava.lang.IllegalStateException
- if no UI component configuration could be loaded for the typenewRootType
and the context codecontextCode
- See Also:
ListViewHelper.ListenerHandler
-
loadListView
public static <E extends TypedObject> ListViewHelper.ListViewInfo loadListView(UIListView listView, java.lang.String contextCode, ObjectTemplate oldRootType, ObjectTemplate newRootType, MutableTableModel tableModel, DefaultListModel<E> listModel, CockpitListComponent<E> cockpitListComp, ListViewHelper.ListenerHandler listenerHandler, DragAndDropContext dndCtx, ListViewConfiguration listViewConf) throws java.lang.IllegalArgumentException, java.lang.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.ListenerHandler
listenerHandler
will only be invoked if a newUIListView
instance 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 benull
cockpitListComp
- theCockpitListComponent
containing the actual itemslistenerHandler
- theListViewHelper.ListenerHandler
responsible 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.ListViewInfo
instance containing the resultingUIListView
instance and some additional information - Throws:
java.lang.IllegalArgumentException
- if eithercontextCode
,newRootType
,itemLoader
ortableModel
(or its internal list component model) is nulljava.lang.IllegalStateException
- if no UI component configuration could be loaded for the typenewRootType
and the context codecontextCode
- See Also:
ListViewHelper.ListenerHandler
-
isForceFireEvent
public static boolean isForceFireEvent()
-
getListViewConfiguration
public static ListViewConfiguration getListViewConfiguration(ObjectTemplate objectTemplate, java.lang.String contextCode)
-
-