|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.swinger.text2gui.ComponentAddStrategy
public class ComponentAddStrategy
The default implementation of IComponentAddStrategy
that
simply passes the constraint to Container.add()
. It uses a
converter passed to the constructor to convert strings and bundle keys to
constraints.
Field Summary | |
---|---|
protected IInterpolatingConverter |
_constraintConverter
The string converter used to convert to constraints. |
static ComponentAddStrategy |
DEFAULT_INSTANCE
The default instance of this class which uses the default constructor. |
Constructor Summary | |
---|---|
protected |
ComponentAddStrategy()
Construct a new instance that uses constraint strings themselves as constraints. |
|
ComponentAddStrategy(IInterpolatingConverter constraintConverter)
Construct a new instance that uses the argument converter as both the string to constraint converter and the resource bundle to constraint converter. |
Method Summary | |
---|---|
void |
addComponent(java.lang.Object container,
java.lang.Object component,
java.lang.Object constraint)
Add component to container using Container.add() , passing
the argument constraint the constraint parameter if
non-null. |
java.lang.String |
name()
Return the result of invoking name() on the constraint
converter. |
java.lang.Object |
toObject(java.util.ResourceBundle bundle,
java.lang.String baseKey,
INoReturnMap argMap,
KeyLookupRecord context)
Convert a set of resource bundle keys representing a constraint to an actual constraint. |
java.lang.Object |
toObject(java.lang.String s,
java.util.ResourceBundle bundle,
INoReturnMap argMap,
KeyLookupRecord context)
Convert a string representing a constraint to an actual constraint. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IInterpolatingConverter _constraintConverter
public static final ComponentAddStrategy DEFAULT_INSTANCE
Constructor Detail |
---|
protected ComponentAddStrategy()
public ComponentAddStrategy(IInterpolatingConverter constraintConverter)
java.lang.NullPointerException
- if constraintConverter
is
null
Method Detail |
---|
public void addComponent(java.lang.Object container, java.lang.Object component, java.lang.Object constraint)
Container.add()
, passing
the argument constraint the constraint
parameter if
non-null.
addComponent
in interface IComponentAddStrategy
container
- The container to which to add the component. Normally,
this will be an instance of Container
.component
- The component to add to the container. Normally,
this will be an instance of Component
.constraint
- The constraint for adding the component to the
container. A null
value indicates no constraint.public java.lang.Object toObject(java.lang.String s, java.util.ResourceBundle bundle, INoReturnMap argMap, KeyLookupRecord context) throws java.text.ParseException, java.util.MissingResourceException
toObject
in interface IInterpolatingStringToObjectConverter
java.text.ParseException
java.util.MissingResourceException
public java.lang.Object toObject(java.util.ResourceBundle bundle, java.lang.String baseKey, INoReturnMap argMap, KeyLookupRecord context) throws java.text.ParseException, java.util.MissingResourceException
toObject
in interface IInterpolatingResourceBundleToObjectConverter
java.text.ParseException
java.util.MissingResourceException
public java.lang.String name()
name()
on the constraint
converter.
name
in interface IInterpolatingConverter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |