Class JListHelper

java.lang.Object
nz.ac.waikato.cms.gui.core.JListHelper

public class JListHelper extends Object
A helper class for JList GUI elements with DefaultListModel or derived models.
Version:
$Revision: 4584 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    moves items down.
    static final int
    moves items up.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checks whether the selected items can be moved down.
    static boolean
    checks whether the selected items can be moved up.
    static void
    moves the selected items to the end.
    static void
    moves the selected item down by 1.
    protected static void
    moveItems(JList list, int moveby, int direction)
    moves the selected items by a certain amount of items in a given direction.
    static void
    moveTop(JList list)
    moves the selected items to the top.
    static void
    moveUp(JList list)
    moves the selected items up by 1.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • JListHelper

      public JListHelper()
  • Method Details

    • moveItems

      protected static void moveItems(JList list, int moveby, int direction)
      moves the selected items by a certain amount of items in a given direction.
      Parameters:
      list - the JList to work on
      moveby - the number of items to move by
      direction - the direction to move in
      See Also:
    • moveUp

      public static void moveUp(JList list)
      moves the selected items up by 1.
      Parameters:
      list - the JList to work on
    • moveDown

      public static void moveDown(JList list)
      moves the selected item down by 1.
      Parameters:
      list - the JList to work on
    • moveTop

      public static void moveTop(JList list)
      moves the selected items to the top.
      Parameters:
      list - the JList to work on
    • moveBottom

      public static void moveBottom(JList list)
      moves the selected items to the end.
      Parameters:
      list - the JList to work on
    • canMoveUp

      public static boolean canMoveUp(JList list)
      checks whether the selected items can be moved up.
      Parameters:
      list - the JList to work on
      Returns:
      true if the selected items can be moved
    • canMoveDown

      public static boolean canMoveDown(JList list)
      checks whether the selected items can be moved down.
      Parameters:
      list - the JList to work on
      Returns:
      true if the selected items can be moved