@Beta public class CompositeCommand extends CommandBase
Command
references internally.
It allows you to hook up multiple command targets to a single root command that itself can be hooked up to a command source such as a button or menu item.
The CompositeCommand
can hold references to any object
but typically you will use it in
conjunction with DelegateCommand
s.
When the execute()
method is invoked it will invoke the Command.execute()
method on each
of the child commands.
When CommandBase.isExecutable()
is called to determine whether the command is enabled, it polls its child commands for
their result from CommandBase.isExecutable()
.
Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyDoubleProperty |
progress |
executableProperty, notExecutableProperty, notRunningProperty, runningProperty
executable, notExecutable, notRunning, running
Constructor and Description |
---|
CompositeCommand(Command... commands)
Creates a
CompositeCommand with given commands. |
Modifier and Type | Method and Description |
---|---|
void |
execute()
This method will be called when the command is invoked.
|
double |
getProgress()
Gets the value of the property progress.
|
javafx.beans.property.ReadOnlyDoubleProperty |
progressProperty() |
void |
register(Command command)
Registers a new
Command for aggregation. |
void |
unregister(Command command)
Unregisters a
Command from aggregation. |
executableProperty, isExecutable, isNotExecutable, isNotRunning, isRunning, notExecutableProperty, notRunningProperty, runningProperty
public javafx.beans.property.ReadOnlyDoubleProperty progressProperty
getProgress()
public CompositeCommand(Command... commands)
CompositeCommand
with given commands.commands
- to aggregatepublic void register(Command command)
Command
for aggregation.command
- to registerpublic void unregister(Command command)
Command
from aggregation.command
- to unregisterpublic void execute()
Command
execute
in interface Command
execute
in class CommandBase
public double getProgress()
public javafx.beans.property.ReadOnlyDoubleProperty progressProperty()
getProgress()
Copyright © 2015 Saxonia Systems AG. All rights reserved.