java.lang.Object
javafx.scene.input.CommandBase<T>
javafx.scene.input.SimpleCommand<T>
- All Implemented Interfaces:
Command<T>
public class SimpleCommand<T> extends CommandBase<T>
A command implementation that synchronously invokes a user-specified method.
-
Property Summary
Properties inherited from class javafx.scene.input.CommandBase
executable, executing -
Constructor Summary
Constructors Constructor Description SimpleCommand(Runnable executeMethod)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Runnable executeMethod, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Runnable executeMethod, ObservableValue<Boolean> condition)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Runnable executeMethod, ObservableValue<Boolean> condition, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Consumer<T> executeMethod)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Consumer<T> executeMethod, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Consumer<T> executeMethod, ObservableValue<Boolean> condition)Initializes a new instance of theSimpleCommandclass.SimpleCommand(Consumer<T> executeMethod, ObservableValue<Boolean> condition, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass. -
Method Summary
Methods inherited from class javafx.scene.input.CommandBase
endExecution, executableProperty, executingProperty, startExecutionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javafx.scene.input.Command
isExecutable, isExecuting
-
Constructor Details
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterless operation
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterized operation
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterless operationexceptionHandler- handler for exceptions thrown by the operation; if none is provided, exceptions will be thrown on the calling thread
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterized operationexceptionHandler- handler for exceptions thrown by the operation; if none is provided, exceptions will be thrown on the calling thread
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterless operationcondition- a value that controls the executability of the command
-
SimpleCommand
Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- aRunnablethat represents a parameterized operationcondition- a value that controls the executability of the command
-
SimpleCommand
public SimpleCommand(Runnable executeMethod, ObservableValue<Boolean> condition, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterless operationcondition- a value that controls the executability of the commandexceptionHandler- handler for exceptions thrown by the operation; if none is provided, exceptions will be thrown on the calling thread
-
SimpleCommand
public SimpleCommand(Consumer<T> executeMethod, ObservableValue<Boolean> condition, Consumer<Throwable> exceptionHandler)Initializes a new instance of theSimpleCommandclass.- Parameters:
executeMethod- a parameterized operationcondition- a value that controls the executability of the commandexceptionHandler- handler for exceptions thrown by the operation; if none is provided, exceptions will be thrown on the calling thread
-
-
Method Details
-
execute
Description copied from interface:CommandExecutes the command.- Parameters:
parameter- the parameter that is passed to the command implementation
-