|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.jdnc.form.ComponentMap
public class ComponentMap
Choosing strategy for creating components.
Extracted from DefaultFormFactory to have a "pluggable" place for creating custom components. The usage of a ComponentCreator should be viewed as an implementation detail, they don't do much.
The created components have their name property set to metaData.name. This will enable searching for them in a container and facilitates testing.
PENDING: should be factored into an interface and a default implementation.
PENDING: think about task distribution - only visual aspects of the metaData should be handled here.
Nested Class Summary | |
---|---|
static class |
ComponentMap.BooleanCreator
|
static class |
ComponentMap.DatePickerCreator
|
static class |
ComponentMap.EnumerationCreator
|
static class |
ComponentMap.FormCreator
|
static class |
ComponentMap.ImagePanelCreator
|
static class |
ComponentMap.LabelCreator
|
static class |
ComponentMap.LinkLabelCreator
|
static class |
ComponentMap.ListCreator
|
class |
ComponentMap.NumberCreator
creates JSpinner if metaData is NumberMetaData, the map's fallback component otherwise. |
static class |
ComponentMap.TableCreator
|
static class |
ComponentMap.TextCreator
creates and returns a JTextComponent. |
Constructor Summary | |
---|---|
ComponentMap()
|
Method Summary | |
---|---|
protected java.lang.Class |
checkForArray(java.lang.Class elementClass)
|
javax.swing.JComponent |
createComponent(MetaData metaData)
creates and returns a component based on the given MetaData. |
protected ComponentCreator |
findByClass(java.lang.Class elementClass)
|
protected ComponentCreator |
findByElementClass(java.lang.Class elementClass)
|
protected ComponentCreator |
getComponentCreator(MetaData metaData)
Encapsulates lookup-strategy to find a fitting ComponentCreator. |
protected ComponentCreator |
getFallBackComponentCreator()
|
static ComponentMap |
getInstance()
|
protected void |
initAssignablesClasses(java.util.List assignables)
|
protected void |
initCreators(java.util.Map map)
|
static void |
setInstance(ComponentMap map)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentMap()
Method Detail |
---|
public static ComponentMap getInstance()
public static void setInstance(ComponentMap map)
public javax.swing.JComponent createComponent(MetaData metaData)
metaData
-
protected ComponentCreator getComponentCreator(MetaData metaData)
Here:
metaData
-
java.lang.NullPointerException
- if metaData == nullprotected ComponentCreator findByElementClass(java.lang.Class elementClass)
protected java.lang.Class checkForArray(java.lang.Class elementClass)
protected ComponentCreator findByClass(java.lang.Class elementClass)
protected ComponentCreator getFallBackComponentCreator()
protected void initCreators(java.util.Map map)
protected void initAssignablesClasses(java.util.List assignables)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |