public interface ComponentStore
Definition of an interface for objects that are able to manage entities
related to a Form
object.
Objects implementing this interface are able to store
s, FieldHandler
s,
and simple components. All these entities can also be accessed by name.
ComponentHandler
This interface is especially useful when a Form
object is
constructed. If this is done by a builder, all components created
during the builder operation must be collected. It is even possible that
multiple component stores are involved, e.g. if there are complex components,
which create their own sub forms. In such cases having multiple - even
different - implementations of the ComponentStore
interface can
be helpful.
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
Object component)
Adds the specified component to this component store under the given
name.
|
void |
addComponentHandler(String name,
ComponentHandler<?> handler)
Adds the specified component handler to this component store under the
given name.
|
void |
addFieldHandler(String name,
FieldHandler fldHandler)
Adds the specified field handler to this component store.
|
Object |
findComponent(String name)
Returns the component with the given name.
|
ComponentHandler<?> |
findComponentHandler(String name)
Returns the component handler with the given name.
|
FieldHandler |
findFieldHandler(String name)
Returns the field handler with the given name.
|
Set<String> |
getComponentHandlerNames()
Returns a set with the names of all component handlers that are contained
in this store.
|
Set<String> |
getComponentNames()
Returns a set with the names of all components that are contained in this
store.
|
Set<String> |
getFieldHandlerNames()
Returns a set with the names of all field handlers that are contained in
this store.
|
void add(String name, Object component)
name
- the name of the componentcomponent
- the component itselfvoid addComponentHandler(String name, ComponentHandler<?> handler)
name
- the name of the componenthandler
- the component handlervoid addFieldHandler(String name, FieldHandler fldHandler)
ComponentHandler
manually.name
- the name of the componentfldHandler
- the field handler to be addedObject findComponent(String name)
name
- the name of the desired componentComponentHandler<?> findComponentHandler(String name)
addComponentHandler(String, ComponentHandler)
.
If no such component handler can be found, null is returned.name
- the name of the desired component handlerFieldHandler findFieldHandler(String name)
addFieldHandler(String, FieldHandler)
. If no
such field handler can be found, null is returned.name
- the name of the desired field handlerSet<String> getComponentNames()
Set<String> getComponentHandlerNames()
Copyright © 2016 The JGUIraffe Team. All rights reserved.