|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.swinger.text2gui.ComponentAddStrategyProvider
public class ComponentAddStrategyProvider
A concrete implementation of IComponentAddStrategyProvider
which uses a map from layout classes to component add strategies.
Field Summary | |
---|---|
protected static java.util.Map |
_DEFAULT_LAYOUT_CLASS_TO_ADD_STRATEGY_MAP
A map from class objects of layout managers to instances of ComponentAddStrategy that specify how to add components to
containers with the corresponding layouts. |
protected java.util.Map |
_layoutClassToAddStrategyMap
The map from layout classes to component add strategies. |
static ComponentAddStrategyProvider |
DEFAULT_INSTANCE
The default instance of this class, which uses the zero-argument constructor. |
Constructor Summary | |
---|---|
protected |
ComponentAddStrategyProvider()
Construct an instance using the default layout class to component add strategy map. |
|
ComponentAddStrategyProvider(java.util.Map layoutClassToAddStrategyMap)
Construct an instance using the argument layout class to component add strategy map. |
Method Summary | |
---|---|
IComponentAddStrategy |
getComponentAddStrategy(java.awt.Container container)
Look up the class of the layout in the map provided to the constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Map _layoutClassToAddStrategyMap
protected static final java.util.Map _DEFAULT_LAYOUT_CLASS_TO_ADD_STRATEGY_MAP
ComponentAddStrategy
that specify how to add components to
containers with the corresponding layouts.
public static final ComponentAddStrategyProvider DEFAULT_INSTANCE
Constructor Detail |
---|
protected ComponentAddStrategyProvider()
DEFAULT_INSTANCE
and has no state, this constructor is
protected.
public ComponentAddStrategyProvider(java.util.Map layoutClassToAddStrategyMap)
Method Detail |
---|
public IComponentAddStrategy getComponentAddStrategy(java.awt.Container container)
Look up the class of the layout in the map provided to the constructor. If the class is found, return the corresponding strategy. Otherwise, use reflection to compute the superclass of the layout, and repeat.
getComponentAddStrategy
in interface IComponentAddStrategyProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |