public abstract static class Task.InputBlocker extends AbstractBean
block
and unblock
that
do the work of blocking the GUI. For the sake of input blocking,
a Task begins executing when it's submitted
to a TaskService
, and it finishes executing after
the Task's completion methods have been called.
The InputBlocker's BlockingScope
and the blocking target
object define
what part of the GUI's input will be blocked:
Task.BlockingScope.NONE
Task.BlockingScope.ACTION
Action
while the Task is executing.
Task.BlockingScope.COMPONENT
Component
Component while the Task is executing.
Task.BlockingScope.WINDOW
Task.BlockingScope.Application
Input blocking begins when the block
method is called and
ends when unblock
is called. Each method is only
called once, typically by the TaskService
.
Constructor and Description |
---|
Task.InputBlocker(Task task,
Task.BlockingScope scope,
Object target)
Construct an InputBlocker.
|
Task.InputBlocker(Task task,
Task.BlockingScope scope,
Object target,
ApplicationAction action)
Construct an InputBlocker with four immutable properties.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
block()
Block input to the GUI per the
scope and target
properties. |
ApplicationAction |
getAction()
The ApplicationAction (
@Action ) that caused
the task to be executed. |
Task.BlockingScope |
getScope()
Defines the extent to which the GUI is blocked while
the task is being executed.
|
Object |
getTarget()
Specifies the GUI element that will be blocked while
the task is being executed.
|
Task |
getTask()
The
block method will block input while this Task
is being executed by a TaskService. |
protected abstract void |
unblock()
Unblock input to the GUI by undoing whatever the
block
method did. |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
public Task.InputBlocker(Task task, Task.BlockingScope scope, Object target, ApplicationAction action)
BlockingScope.ACTION
then target must be
a Action
. If scope is
BlockingScope.WINDOW
or BlockingScope.COMPONENT
then target must be a Component.task
- block input while this Task is executingscope
- how much of the GUI will be blockedtarget
- the GUI element that will be blockedaction
- the @Action
that triggered running the task, or nullTaskService.execute(org.jdesktop.application.Task)
public Task.InputBlocker(Task task, Task.BlockingScope scope, Object target)
target
is an
ApplicationAction
, it becomes the InputBlocker's
action
. If the Task is null or if the Task has already been
executed by a TaskService, then an exception is thrown.task
- block input while this Task is executingscope
- how much of the GUI will be blockedtarget
- the GUI element that will be blockedTaskService.execute(org.jdesktop.application.Task)
public final Task getTask()
block
method will block input while this Task
is being executed by a TaskService.public final Task.BlockingScope getScope()
public final Object getTarget()
This property may be null.
getScope()
,
block()
,
unblock()
public final ApplicationAction getAction()
@Action
) that caused
the task to be executed. The DefaultInputBlocker uses
the action's name
and resourceMap
to
configure its blocking dialog if scope
is
BlockingScope.WINDOW
.
This property may be null.
getScope()
,
block()
,
unblock()
,
ApplicationAction.getName()
,
ApplicationAction.getResourceMap()
protected abstract void block()
scope
and target
properties. This method will only be called once.protected abstract void unblock()
block
method did. This method will only be called once.Copyright © 2009–2014. All rights reserved.