Class ListViewHelper
- java.lang.Object
-
- de.hybris.platform.cockpit.model.listview.ListViewHelper
-
public class ListViewHelper extends java.lang.ObjectHelper 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 interfaceListViewHelper.ListenerHandlerResponsible for registering/unregistering listeners used by a list view.static classListViewHelper.ListViewInfoHolds list view creation information.
-
Constructor Summary
Constructors Constructor Description ListViewHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcellChanged(UIListView view, int colIndex, int rowIndex, java.lang.Object eventSource)static ListViewConfigurationgetListViewConfiguration(ObjectTemplate objectTemplate, java.lang.String contextCode)static booleanisForceFireEvent()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.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:
java.lang.IllegalArgumentException- if eithercontextCode,newRootType,itemLoaderortableModel(or its internal list component model) is nulljava.lang.IllegalStateException- if no UI component configuration could be loaded for the typenewRootTypeand 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.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:
java.lang.IllegalArgumentException- if eithercontextCode,newRootType,itemLoaderortableModel(or its internal list component model) is nulljava.lang.IllegalStateException- if no UI component configuration could be loaded for the typenewRootTypeand the context codecontextCode- See Also:
ListViewHelper.ListenerHandler
-
isForceFireEvent
public static boolean isForceFireEvent()
-
getListViewConfiguration
public static ListViewConfiguration getListViewConfiguration(ObjectTemplate objectTemplate, java.lang.String contextCode)
-
-