public final class SwingConfigurationManager
extends java.lang.Object
gr.zeus.ui.typesafe
package. Although each class can be used as
standalone, the SwingConfigurationManager provides an easy way to configure
multiple swing components within many forms via a property file. You can have
as many instances of this class as you need, just keep in mind that each
instance is attached to a single property file. The property file can also
exist inside a ResourceBundle. Aside the constructors the main methods are:
applyFocus(), initializes the focus for a container and configComponent(),
that configures all the swing components. Property file format example:
Note: Due to the internal design of the JFormattedTextField, the TypeSafeTextDocumentFilter is not applied (see Sun's javadocs). Only the Verifier's functionality is applied.
Constructor and Description |
---|
SwingConfigurationManager(java.util.ResourceBundle res)
Constructor, creates the properties from the specified ResourceBundle.
|
SwingConfigurationManager(java.lang.String propertyFile)
Constructor, loads the property file from the specified pathname.
|
Modifier and Type | Method and Description |
---|---|
void |
applyFocus(java.awt.Container c,
java.awt.Component[] all)
Apply focus policy to all the components in the array, depending on the
component's placement within this array.
|
void |
configComponent(java.lang.String name,
javax.swing.text.JTextComponent... all)
Apply a configuration to one or more components.
|
public SwingConfigurationManager(java.lang.String propertyFile)
propertyFile
- The pathname to the property file.public SwingConfigurationManager(java.util.ResourceBundle res)
res
- The resource bundle to load the properties from.public void applyFocus(java.awt.Container c, java.awt.Component[] all)
c
- The swing container, e.g. a JFrame.all
- The array with the components.public void configComponent(java.lang.String name, javax.swing.text.JTextComponent... all) throws java.lang.Exception
name
- The tagname within the property file.all
- One or more components to apply the
configuration rule.java.lang.Exception