|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ControlBeanContext
The ControlBeanContext interface defines the basic set of contextual services and lifecycle events for Java ControlBean implementations.
ControlBeanContext also extends the java.beans.beancontext.BeanContextServices
interface, so it also provide core Java Beans services for managing contained controls,
looking up contextual services, and locating the parent BeanContext
context.
A Control implementation class can obtain access to the ControlBeanContext associated
with it by declaring an instance field of this type and annotating it with the
org.apache.beehive.controls.api.context.Context
annotation, as in the following
example:
The Java Control runtime will automatically initialize this field to a reference to the
ControlBeanContext associated with the implementation instance.
import org.apache.beehive.controls.api.context.Context;
import org.apache.beehive.controls.api.context.ControlBeanContext;
Nested Class Summary | |
---|---|
static interface |
ControlBeanContext.LifeCycle
The Lifecycle event interface defines a set of lifecycle events exposed by the ControlBeanContext to any registered listener. |
Field Summary |
---|
Fields inherited from interface BeanContext |
---|
globalHierarchyLock |
Fields inherited from interface DesignMode |
---|
PROPERTYNAME |
Method Summary | ||
---|---|---|
void |
addLifeCycleListener(ControlBeanContext.LifeCycle listener)
Registers a new listener for LifeCycle events on the context. |
|
PropertyMap |
getAnnotationMap(AnnotatedElement annotElem)
Returns the PropertyMap containing default properties for an AnnotatedElement in the current context. |
|
ControlBean |
getBean(String id)
Returns any child ControlBean that is nested in the ControlBeanContext, or null if no matching child is found. |
|
ClassLoader |
getClassLoader()
Returns the ClassLoader used to load the ControlBean class associated with the control implementation instance. |
|
ControlBean |
getControlBean()
Returns the peer ControlBean associated with this ControlBeanContext. |
|
ControlHandle |
getControlHandle()
Returns a ControlHandle instance that enables operations and events to be dispatched to the target control, if it is running inside of a container that supports external event dispatch. |
|
Class |
getControlInterface()
Returns the public or extension interface associated with the context |
|
PropertyMap |
getControlPropertyMap()
Returns the current set of properties (in PropertyMap format) for the control associated with the context. |
|
|
getControlPropertySet(Class<T> propertySet)
Returns the current value of PropertySet for the associated control, or null if the property set has not been bound. |
|
|
getMethodPropertySet(Method m,
Class<T> propertySet)
Returns the current value of PropertySet for the provided method, or null if the property set has not been bound for this method. |
|
String[] |
getParameterNames(Method m)
Returns an array containing the parameter names for the specified method |
|
|
getParameterPropertySet(Method m,
int i,
Class<T> propertySet)
Returns the current value of PropertySet for the selected (by index) method parameter, or null if the property set has not been bound for this method. |
|
Object |
getParameterValue(Method m,
String parameterName,
Object[] parameters)
Returns the value of a named method parameter from the input parameter array. |
|
|
getService(Class<T> serviceClass,
Object selector)
Returns an instance of a contextual service based upon the local context. |
|
boolean |
isSingleThreadedContainer()
Returns true if this container guarantees single-threaded behaviour. |
|
void |
removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
Removes a currently registered LifeCycle event listener on the context. |
Methods inherited from interface BeanContextServices |
---|
addBeanContextServicesListener, addService, getCurrentServiceClasses, getCurrentServiceSelectors, getService, hasService, releaseService, removeBeanContextServicesListener, revokeService |
Methods inherited from interface BeanContext |
---|
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener |
Methods inherited from interface BeanContextChild |
---|
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
Methods inherited from interface Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface DesignMode |
---|
isDesignTime, setDesignTime |
Methods inherited from interface Visibility |
---|
avoidingGui, dontUseGui, needsGui, okToUseGui |
Methods inherited from interface BeanContextServicesListener |
---|
serviceAvailable |
Methods inherited from interface BeanContextServiceRevokedListener |
---|
serviceRevoked |
Method Detail |
---|
Class getControlInterface()
<T extends Annotation> T getControlPropertySet(Class<T> propertySet)
propertySet
- the PropertySet to return
PropertySet
<T extends Annotation> T getMethodPropertySet(Method m, Class<T> propertySet) throws IllegalArgumentException
m
- the Method to check for properties.propertySet
- the PropertySet to return
IllegalArgumentException
PropertySet
<T extends Annotation> T getParameterPropertySet(Method m, int i, Class<T> propertySet) throws IllegalArgumentException, IndexOutOfBoundsException
m
- the Method to check for propertiesi
- the index of the method parameter to check for the request PropertySetpropertySet
- the PropertySet to return
IllegalArgumentException
IndexOutOfBoundsException
String[] getParameterNames(Method m) throws IllegalArgumentException
m
- the Method whose parameter names should be returned.
IllegalArgumentException
Object getParameterValue(Method m, String parameterName, Object[] parameters) throws IllegalArgumentException
m
- the Method associated with the input parameter listparameterName
- the name of the requested parameterparameters
- the array of method parameters
IllegalArgumentException
PropertyMap getControlPropertyMap()
PropertyMap
<T> T getService(Class<T> serviceClass, Object selector)
serviceClass
- the class of the requested serviceselector
- the service dependent parameter
BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener)
ControlHandle getControlHandle()
ControlHandle
PropertyMap getAnnotationMap(AnnotatedElement annotElem)
ClassLoader getClassLoader()
boolean isSingleThreadedContainer()
ControlBean getControlBean()
ControlBean getBean(String id)
id
parameter is relative to
the current nesting context, not an absolute control id.
void addLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext.LifeCycle
void removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext.LifeCycle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |