Package adams.gui.core
Class JListHelper
- java.lang.Object
-
- adams.gui.core.JListHelper
-
public class JListHelper extends Object
A helper class for JList GUI elements with DefaultListModel or derived models.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
JList
,DefaultListModel
-
-
Constructor Summary
Constructors Constructor Description JListHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static boolean
canHandleModel(JList list)
Returns whether the list model can be handled.static boolean
canMoveDown(JList list)
checks whether the selected items can be moved down.static boolean
canMoveUp(JList list)
checks whether the selected items can be moved up.static void
moveBottom(JList list)
moves the selected items to the end.static void
moveDown(JList list)
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.
-
-
-
Field Detail
-
MOVE_UP
public static final int MOVE_UP
moves items up.- See Also:
- Constant Field Values
-
MOVE_DOWN
public static final int MOVE_DOWN
moves items down.- See Also:
- Constant Field Values
-
-
Method Detail
-
canHandleModel
protected static boolean canHandleModel(JList list)
Returns whether the list model can be handled.- Parameters:
list
- the list to check- Returns:
- true if model can be used
-
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.
-
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
-
-