It is possible to associate arbitrary properties with a Job
, which can be used to present its progress in different ways. For example, by specifying a command, it's possible to click on a running job and then execute something in the user interface, such as a detailed job description. Job
properties are set with setProperty
and can include any key/value combination. The keys use a QualifiedName
, which is like a pair of strings for namespace/value. In the case of the progress view, there is an IProgressConstants2
interface that defines what values can be set, including COMMAND_PROPERTY
, which can be used to associate a command with a Job
.
Open the
HelloHandler
and go to theexecute
method. Just before theJob
is scheduled, acquire theCommand
from theICommandService
and then stamp it on thejob
as a property. This will require adding an argument into the method signature and addingorg.eclipse.core.commands
as a dependent bundle:public void execute...