|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.text.AbstractInterpolatingStringToObjectConverter
com.taco.text.InterpolatingConverter
com.taco.text.DispatchingConverter
com.taco.swinger.text2gui.DispatchingComponentConverter
public class DispatchingComponentConverter
A converter from resource bundles or strings to components. Because
there exists a wide variety of components, this class acts as a dispatcher
to installed string to component. The first word of a string is used to
select the appropriate component converter for the entire string. By
itself, this class supports the following types of components:
JApplet
, JFrame
, JDialog
,
JWindow
, JOptionPane
, JPanel
,
Box
, JLayeredPane
, JDesktopPane
,
JSplitPane
, JTabbedPane
,
JScrollPane
, JInternalFrame
,
JLayeredPane
, JDesktopPane
, JButton
,
JRadioButton
, JCheckBox
, JMenu
,
JMenuItem
, JCheckBoxMenuItem
,
JRadioButtonMenuItem
, JLabel
,
JToolBar
, JTextField
,
JPasswordTextField
, JFormattedTextField
,
JTextArea
, JEditorPane
, JComboBox
,
JSlider
, JSpinner
, JProgressBar
,
JScrollBar
, JList
, JTable
,
JTree
, glue, rigid area, and filler.
Additional types of components can be installed with
installConverter()
.
Field Summary | |
---|---|
protected IComponentAddStrategyProvider |
_componentAddStrategyProvider
The provider of strategies for adding components to a container. |
static DispatchingComponentConverter |
DEFAULT_INSTANCE
The default instance of this class, which uses the default component add strategy provider. |
Fields inherited from class com.taco.text.DispatchingConverter |
---|
_suffixToTypeMap, _typeToConfigurerMap, _typeToConverterMap |
Fields inherited from class com.taco.text.InterpolatingConverter |
---|
_BAD_OBJECT_MAPPER, _IGNORE_PROPERTY_VALUE, _IMPORTS, _STATIC_IMPORTS, _TO_OBJECT_MAPPER_CONVERTER |
Fields inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter |
---|
_defArgMap, _defBundle |
Constructor Summary | |
---|---|
DispatchingComponentConverter()
Create a new instance which uses the default instance of ComponentAddStrategyProvider . |
|
DispatchingComponentConverter(IComponentAddStrategyProvider provider)
Create a new instance which uses provider to provide
component adders for layouts. |
|
DispatchingComponentConverter(IComponentAddStrategyProvider provider,
java.util.ResourceBundle bundle,
INoReturnMap argMap)
Create a new instance which uses provider to provide
component adders for layouts. |
Method Summary | |
---|---|
protected void |
_installSuffixToTypeMappings()
Install mappings from resource bundle key suffixes to dispatch types, in case the ".dispatchType" subkey is not present. |
IComponentAddStrategyProvider |
getComponentAddStrategyProvider()
Return the provider of component add strategies. |
static java.awt.Window |
getDisplayWindow(java.lang.Object obj,
java.lang.String title)
Return a window suitable for displaying the argument object. |
static void |
main(java.lang.String[] args)
A simple test program. |
void |
setComponentAddStrategyProvider(IComponentAddStrategyProvider componentAddStrategyProvider)
Set the provider of component add strategies. |
java.awt.Component |
toComponent(java.util.ResourceBundle bundle,
java.lang.String baseKey,
INoReturnMap argMap)
Return the result of converting the bundle key to a component. |
Methods inherited from class com.taco.text.DispatchingConverter |
---|
_getTypeForSuffix, _guessType, _literalToObject, _toObject, clone, configureComposite, getConfigurerForType, getConverterForType, installConfigurer, installConverter, installTypeForSuffix, name |
Methods inherited from class com.taco.text.InterpolatingConverter |
---|
_argMapReferenceToObject, _getStandardImports, _getStandardStaticImports, _literalResultToObject, _scriptSnippetToObject, _toObjectMapper, toObject, toObject, toObject |
Methods inherited from class com.taco.text.AbstractInterpolatingStringToObjectConverter |
---|
toObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IComponentAddStrategyProvider _componentAddStrategyProvider
public static final DispatchingComponentConverter DEFAULT_INSTANCE
Constructor Detail |
---|
public DispatchingComponentConverter()
ComponentAddStrategyProvider
. The instance's
implementation of IStringToObjectConverter
is incapable of
resolving references.
public DispatchingComponentConverter(IComponentAddStrategyProvider provider)
provider
to provide
component adders for layouts. The instance's implementation of
IStringToObjectConverter
is incapable of
resolving references.
public DispatchingComponentConverter(IComponentAddStrategyProvider provider, java.util.ResourceBundle bundle, INoReturnMap argMap)
provider
to provide
component adders for layouts. The instance's implementation of
IStringToObjectConverter
uses the specified resource
bundle and argument map to resolve references.
Method Detail |
---|
public IComponentAddStrategyProvider getComponentAddStrategyProvider()
public void setComponentAddStrategyProvider(IComponentAddStrategyProvider componentAddStrategyProvider)
public static void main(java.lang.String[] args)
public static final java.awt.Window getDisplayWindow(java.lang.Object obj, java.lang.String title)
protected void _installSuffixToTypeMappings()
".dispatchType"
subkey is not present. For
each converter and configurer type, see if it begins with 'j'
. If so, use the part
after the 'j'
as the suffix, and map the suffix to the
type.
public final java.awt.Component toComponent(java.util.ResourceBundle bundle, java.lang.String baseKey, INoReturnMap argMap) throws java.text.ParseException, java.util.MissingResourceException
JComponent
before returning it.
This a convenience method intended to be called by the user.
java.text.ParseException
java.util.MissingResourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |