public interface ComponentLifecycle
Components that implement this interface will get started up and shut down when their containing window is first displayed and closed, respectively. Typically components will implement VisionComponent (which extends ComponentLifecycle) instead of this interface directly.
It is expected that components will fire a PropertyChangeEvent upon the execution of both startupComponent and shutdownComponent, emulating a (potentially) virtual boolean property named "componentRunning". For example,
public void startupComponent(ClientContext context) { // do startup logic firePropertyChange(COMPONENT_RUNNING, false, true); } public void shutdownComponent() { // do shutdown logic firePropertyChange(COMPONENT_RUNNING, true, false); }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPONENT_RUNNING |
Modifier and Type | Method and Description |
---|---|
VisionClientContext |
getAppContext() |
void |
shutdownComponent()
Called when the component is now shown anymore.
|
void |
startupComponent(VisionClientContext context)
Called when the component is first shown.
|
static final java.lang.String COMPONENT_RUNNING
void startupComponent(VisionClientContext context)
void shutdownComponent()
VisionClientContext getAppContext()