public class BgTaskCommand
extends net.sf.jguiraffe.gui.cmd.CommandBase
implements net.sf.jguiraffe.gui.builder.event.FormActionListener
A command class for executing the background task.
This command class simulates the execution of a long-running background task.
The execute() only sleeps a configurable number of seconds, but it
demonstrates how an information dialog with a progress bar can be used to
give the user feedback about the progress of the background task. This visual
feedback is optional; it can be disabled, then the command only sleeps.
| Constructor and Description |
|---|
BgTaskCommand(net.sf.jguiraffe.gui.builder.utils.GUISynchronizer sync,
net.sf.jguiraffe.gui.builder.window.Window infoWindow,
BgTaskData taskData,
net.sf.jguiraffe.gui.builder.components.model.ProgressBarHandler handler)
Creates a new instance of
BgTaskCommand and initializes it. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(net.sf.jguiraffe.gui.builder.event.FormActionEvent e)
Notifies this object that the cancel button was pressed.
|
void |
execute()
Executes this command.
|
protected void |
performGUIUpdate()
Performs UI-related updates after the execution of the command.
|
public BgTaskCommand(net.sf.jguiraffe.gui.builder.utils.GUISynchronizer sync,
net.sf.jguiraffe.gui.builder.window.Window infoWindow,
BgTaskData taskData,
net.sf.jguiraffe.gui.builder.components.model.ProgressBarHandler handler)
BgTaskCommand and initializes it.sync - the GUISynchronizerinfoWindow - the reference to the information windowtaskData - the data object with information about the background
taskhandler - the handler for the progress barpublic void actionPerformed(net.sf.jguiraffe.gui.builder.event.FormActionEvent e)
actionPerformed in interface net.sf.jguiraffe.gui.builder.event.FormActionListenere - the action eventpublic void execute()
throws Exception
execute in interface net.sf.jguiraffe.gui.cmd.CommandExceptionprotected void performGUIUpdate()
performGUIUpdate in class net.sf.jguiraffe.gui.cmd.CommandBaseCopyright © 2016 The JGUIraffe Team. All Rights Reserved.