public abstract class AbstractContextual extends Object implements Contextual
Contextual objects.
Delegates to Context.inject(Object) to do the actual work of
setting the context, injecting service parameters, and registering
EventHandler methods as event subscribers.
Context.inject(Object)| Constructor and Description |
|---|
AbstractContextual() |
| Modifier and Type | Method and Description |
|---|---|
Context |
context()
Gets the application context to which the object belongs.
|
Context |
getContext()
Gets the application context to which the object belongs, or null if
Contextual.setContext(Context) has not yet been called on this object. |
void |
setContext(Context context)
Sets the application context to which the object belongs.
|
public Context context()
Contextualcontext in interface ContextualContextual.getContext()public Context getContext()
ContextualContextual.setContext(Context) has not yet been called on this object.getContext in interface ContextualContextual.context()public void setContext(Context context)
Contextual
Typically this method simply delegates to Context.inject(Object),
and should be called only once to populate the context. Most contextual
objects do not support later alteration of the context, and will throw
IllegalStateException if this method is invoked again.
setContext in interface ContextualContext.inject(Object),
for an example of how to implement this interfaceCopyright © 2009–2016 SciJava. All rights reserved.