Class 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
    • Constructor Detail

      • ListViewHelper

        public ListViewHelper()
    • 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 TypedObjectListViewHelper.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 specified ListViewHelper.ListenerHandler listenerHandler will only be invoked if a new UIListView 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 instance
        contextCode - cockpit UI configuration context code
        oldRootType - last root type
        newRootType - current root type
        tableModel - 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 be null
        cockpitListComp - the CockpitListComponent containing the actual items
        listenerHandler - the ListViewHelper.ListenerHandler responsible for registering/unregistering listeners, controllers etc
        dndCtx - the drag and drop context
        Returns:
        a ListViewHelper.ListViewInfo instance containing the resulting UIListView instance and some additional information
        Throws:
        java.lang.IllegalArgumentException - if either contextCode, newRootType, itemLoader or tableModel (or its internal list component model) is null
        java.lang.IllegalStateException - if no UI component configuration could be loaded for the type newRootType and the context code contextCode
        See Also:
        ListViewHelper.ListenerHandler
      • loadListView

        public static <E extends TypedObjectListViewHelper.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 specified ListViewHelper.ListenerHandler listenerHandler will only be invoked if a new UIListView 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 instance
        contextCode - cockpit UI configuration context code
        oldRootType - last root type
        newRootType - current root type
        tableModel - 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 be null
        cockpitListComp - the CockpitListComponent containing the actual items
        listenerHandler - the ListViewHelper.ListenerHandler responsible for registering/unregistering listeners, controllers etc
        dndCtx - the drag and drop context
        listViewConf - 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 resulting UIListView instance and some additional information
        Throws:
        java.lang.IllegalArgumentException - if either contextCode, newRootType, itemLoader or tableModel (or its internal list component model) is null
        java.lang.IllegalStateException - if no UI component configuration could be loaded for the type newRootType and the context code contextCode
        See Also:
        ListViewHelper.ListenerHandler
      • isForceFireEvent

        public static boolean isForceFireEvent()