Class BaseList

    • Constructor Detail

      • BaseList

        public BaseList()
        Constructs a BaseList with an empty, read-only, model.
      • BaseList

        public BaseList​(Object[] listData)
        Constructs a BaseList that displays the elements in the specified array. This constructor creates a read-only model for the given array, and then delegates to the constructor that takes a ListModel.

        Attempts to pass a null value to this method results in undefined behavior and, most likely, exceptions. The created model references the given array directly. Attempts to modify the array after constructing the list results in undefined behavior.

        Parameters:
        listData - the array of Objects to be loaded into the data model, non-null
      • BaseList

        public BaseList​(Vector<?> listData)
        Constructs a BaseList that displays the elements in the specified Vector. This constructor creates a read-only model for the given Vector, and then delegates to the constructor that takes a ListModel.

        Attempts to pass a null value to this method results in undefined behavior and, most likely, exceptions. The created model references the given Vector directly. Attempts to modify the Vector after constructing the list results in undefined behavior.

        Parameters:
        listData - the Vector to be loaded into the data model, non-null
      • BaseList

        public BaseList​(ListModel dataModel)
        Constructs a BaseList that displays elements from the specified, non-null, model. All BaseList constructors delegate to this one.

        This constructor registers the list with the ToolTipManager, allowing for tooltips to be provided by the cell renderers.

        Parameters:
        dataModel - the model for the list
        Throws:
        IllegalArgumentException - if the model is null
    • Method Detail

      • initGUI

        protected void initGUI()
        Initializes the members.
      • moveUp

        public void moveUp()
        moves the selected items up by 1.
      • moveDown

        public void moveDown()
        moves the selected item down by 1.
      • moveTop

        public void moveTop()
        moves the selected items to the top.
      • moveBottom

        public void moveBottom()
        moves the selected items to the end.
      • canMoveUp

        public boolean canMoveUp()
        checks whether the selected items can be moved up.
        Returns:
        true if the selected items can be moved
      • canMoveDown

        public boolean canMoveDown()
        checks whether the selected items can be moved down.
        Returns:
        true if the selected items can be moved
      • addRemoveItemsListener

        public void addRemoveItemsListener​(RemoveItemsListener l)
        Adds the remove items listener to its internal list.
        Parameters:
        l - the listener to add
      • removeRemoveItemsListener

        public void removeRemoveItemsListener​(RemoveItemsListener l)
        Removes the remove items listener from its internal list.
        Parameters:
        l - the listener to remove
      • notifyRemoveItemsListeners

        protected void notifyRemoveItemsListeners​(int[] indices)
        Notifies the remove items listeners about the indices that are to be removed.
        Parameters:
        indices - the indices that should get removed
      • selectAll

        public void selectAll()
        Selects all items.
      • selectNone

        public void selectNone()
        Select no items.
      • invertSelection

        public void invertSelection()
        Inverts the current selection.