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()
Contextual
context
in interface Contextual
Contextual.getContext()
public Context getContext()
Contextual
Contextual.setContext(Context)
has not yet been called on this object.getContext
in interface Contextual
Contextual.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 Contextual
Context.inject(Object)
,
for an example of how to implement this interface
Copyright © 2009–2016 SciJava. All rights reserved.