public class ComponentConnectionContext extends Object implements ConnectionContext
UI.access(Command)
.Constructor and Description |
---|
ComponentConnectionContext()
Creates an empty component connection context.
|
ComponentConnectionContext(Component component)
Creates a new component connection context which is initially using a
single component.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponent(Component component)
Adds a component instance to track for this context.
|
Registration |
init(ActivationHandler activationHandler,
Executor backgroundRunner)
Initializes the connection context with a
ActivationHandler and
an Executor . |
void |
removeComponent(Component component)
Stops tracking a component for this context.
|
public ComponentConnectionContext()
public ComponentConnectionContext(Component component)
component
- the component to use, not null
public void addComponent(Component component)
component
- the component to track, not null
removeComponent(Component)
public void removeComponent(Component component)
component
- the component to stop tracking, not null
addComponent(Component)
public Registration init(ActivationHandler activationHandler, Executor backgroundRunner)
ConnectionContext
ActivationHandler
and
an Executor
.
The method Consumer.accept(Object)
from the provided
ActivationHandler
should be called with an
ActionDispatcher
when this ConnectionContext is activated. When
this ConnectionContext is deactivated, it should call
Consumer.accept(Object)
with a null parameter.
The ActionDispatcher
should ensure synchronization within the
context of this ConnectionContext.
init
in interface ConnectionContext
activationHandler
- the handler for activation changesbackgroundRunner
- executor that should be used by the handler to execute
background tasks. Not null
null
if there
is nothing to clean upCopyright © 2024. All rights reserved.