Package nz.ac.waikato.cms.gui.core
Class JListHelper
java.lang.Object
nz.ac.waikato.cms.gui.core.JListHelper
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanMoveDown(JList list) checks whether the selected items can be moved down.static booleanchecks whether the selected items can be moved up.static voidmoveBottom(JList list) moves the selected items to the end.static voidmoves the selected item down by 1.protected static voidmoves the selected items by a certain amount of items in a given direction.static voidmoves the selected items to the top.static voidmoves the selected items up by 1.
-
Field Details
-
MOVE_UP
public static final int MOVE_UPmoves items up.- See Also:
-
MOVE_DOWN
public static final int MOVE_DOWNmoves items down.- See Also:
-
-
Constructor Details
-
JListHelper
public JListHelper()
-
-
Method Details
-
moveItems
moves the selected items by a certain amount of items in a given direction. -
moveUp
moves the selected items up by 1.- Parameters:
list- the JList to work on
-
moveDown
moves the selected item down by 1.- Parameters:
list- the JList to work on
-
moveTop
moves the selected items to the top.- Parameters:
list- the JList to work on
-
moveBottom
moves the selected items to the end.- Parameters:
list- the JList to work on
-
canMoveUp
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
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
-