Package net.sf.jguiraffe.gui.forms
Interface ComponentStore
-
- All Known Implementing Classes:
ComponentStoreImpl
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 theComponentStore
interface can be helpful.- Version:
- $Id: ComponentStore.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
add
void add(String name, Object component)
Adds the specified component to this component store under the given name.- Parameters:
name
- the name of the componentcomponent
- the component itself
-
addComponentHandler
void addComponentHandler(String name, ComponentHandler<?> handler)
Adds the specified component handler to this component store under the given name.- Parameters:
name
- the name of the componenthandler
- the component handler
-
addFieldHandler
void addFieldHandler(String name, FieldHandler fldHandler)
Adds the specified field handler to this component store. The caller is responsible for adding the associatedComponentHandler
manually.- Parameters:
name
- the name of the componentfldHandler
- the field handler to be added
-
findComponent
Object findComponent(String name)
Returns the component with the given name. If no such component can be found, null is returned.- Parameters:
name
- the name of the desired component- Returns:
- the component
-
findComponentHandler
ComponentHandler<?> findComponentHandler(String name)
Returns the component handler with the given name. This handler must have been added before using
. If no such component handler can be found, null is returned.addComponentHandler(String, ComponentHandler)
- Parameters:
name
- the name of the desired component handler- Returns:
- the corresponding handler
-
findFieldHandler
FieldHandler findFieldHandler(String name)
Returns the field handler with the given name. This handler must have been added before using
. If no such field handler can be found, null is returned.addFieldHandler(String, FieldHandler)
- Parameters:
name
- the name of the desired field handler- Returns:
- the corresponding handler
-
getComponentNames
Set<String> getComponentNames()
Returns a set with the names of all components that are contained in this store.- Returns:
- a set with the names of the components in this store
-
getComponentHandlerNames
Set<String> getComponentHandlerNames()
Returns a set with the names of all component handlers that are contained in this store.- Returns:
- a set with the names of the component handlers in this store
-
-