public class MoveSelectionCommand extends java.lang.Object implements GUICommand
GUICommand
which moves the selected element in a GUIList
element.Modifier and Type | Field and Description |
---|---|
private int |
diffElements
The distance in elements to scroll.
|
private int |
diffLines
The distance in lines to scroll.
|
private GUIList<?> |
list
The list to scroll.
|
Constructor and Description |
---|
MoveSelectionCommand(GUIList<?> list,
int diffLines,
int diffElements)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute()
Returns whether this command may be executed.
|
void |
execute()
Executes the command.
|
private final int diffElements
private final int diffLines
@NotNull private final GUIList<?> list
public MoveSelectionCommand(@NotNull GUIList<?> list, int diffLines, int diffElements)
list
- the list to scrolldiffLines
- the distance in lines to scrolldiffElements
- the distance in elements to scrollpublic boolean canExecute()
canExecute
in interface GUICommand
public void execute()
GUICommand.canExecute()
returns false
.execute
in interface GUICommand