Package gr.zeus.ui.typesafe
Class SwingConfigurationManager
java.lang.Object
gr.zeus.ui.typesafe.SwingConfigurationManager
This class is the central point of execution for all the classes inside
customfocustraversalpolicy=true/false
(tagname).(param)=(value)
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:
customfocustraversalpolicy=true/false
(tagname).(param)=(value)
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.
- Since:
- 1.20
- Author:
- Gregory Kotsaftis
-
Constructor Summary
ConstructorsConstructorDescriptionSwingConfigurationManager
(String propertyFile) Constructor, loads the property file from the specified pathname.Constructor, creates the properties from the specified ResourceBundle. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyFocus
(Container c, Component[] all) Apply focus policy to all the components in the array, depending on the component's placement within this array.void
configComponent
(String name, JTextComponent... all) Apply a configuration to one or more components.
-
Constructor Details
-
SwingConfigurationManager
Constructor, loads the property file from the specified pathname.- Parameters:
propertyFile
- The pathname to the property file.
-
SwingConfigurationManager
Constructor, creates the properties from the specified ResourceBundle.- Parameters:
res
- The resource bundle to load the properties from.
-
-
Method Details
-
applyFocus
Apply focus policy to all the components in the array, depending on the component's placement within this array. Also changes the traversal keys for all JTextArea, JTextPane and JEditorPane within this array if the appropriate properties are set in the configuration file.- Parameters:
c
- The swing container, e.g. a JFrame.all
- The array with the components.
-
configComponent
Apply a configuration to one or more components.- Parameters:
name
- The tagname within the property file.all
- One or more components to apply the configuration rule.- Throws:
Exception
-