|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.console.ui.util.property.GuiComponentFactory
public class GuiComponentFactory
The GuiComponentFactory
creates JComponent
s and sets
their properties. All JavaBean properties can be set using this class.
For example, to create a JButton
, the properties file entries
could look like this:
btn=javax.swing.JButton.class btn.background=Color.red btn.text="Red Button" btn.mnemonic='R' btn.toolTipText="This is a red button"After the component identifier, in the above example "btn", and after the period separator, the property name is identified starting with a lowercase letter. A
PropertyProvider
identifies which properties
files are searched.
Field Summary | |
---|---|
static java.lang.String |
SEPARATOR
The separator used between component ID and property when composing a properties file key. |
static java.lang.String |
TYPE_DEFS_PROP
The default properties file used in the createTextField(String)
method. |
static java.lang.String |
TYPE_PREFIX
The prefix used to denote data types in property files. |
Method Summary | |
---|---|
static javax.swing.JComponent |
createComponent(java.lang.String theKey,
PropertyProvider thePropProvider)
Creates a JComponent and initializes it's properties using
properties file(s). |
static javax.swing.JPasswordField |
createPasswordField(java.lang.String theType)
Creates a JPasswordField and initializes it by using the
given type. |
static javax.swing.JPasswordField |
createPasswordField(java.lang.String theType,
PropertyProvider thePropProvider)
Creates a JPasswordField and initializes it by using the
given type. |
static TextFieldWidget |
createTextField(java.lang.String theType)
Creates a TextFieldWidget and initializes it by using the
given type. |
static TextFieldWidget |
createTextField(java.lang.String theType,
PropertyProvider thePropProvider)
Creates a TextFieldWidget and initializes by using the given
type. |
static TextFieldWidget |
createTextField(java.lang.String theType,
java.lang.String theKey,
PropertyProvider thePropProvider)
Creates a TextFieldWidget and initializes by using the given
type. |
static void |
setProperties(java.lang.String theKey,
javax.swing.JComponent theComponent,
PropertyProvider thePropProvider)
Sets the JavaBean properties of a component based on entries in one or more properties files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SEPARATOR
public static final java.lang.String TYPE_DEFS_PROP
createTextField(String)
method.
public static final java.lang.String TYPE_PREFIX
Method Detail |
---|
public static javax.swing.JComponent createComponent(java.lang.String theKey, PropertyProvider thePropProvider)
JComponent
and initializes it's properties using
properties file(s).
theKey
- the properties file keythePropProvider
- the provider that determines the file(s) to look
at
java.lang.IllegalArgumentException
- if either input parameter is
null
, the key cannot be found, the value is not a
String
object, the value is not a class name, or the class is
not an instanceof JComponent
.
.public static javax.swing.JPasswordField createPasswordField(java.lang.String theType)
JPasswordField
and initializes it by using the
given type. If the type is not found by the provider, a default field
is returned. The default provider is used.
theType
- the data type key
java.lang.IllegalArgumentException
- if input parameter is null
createTextField(String, PropertyProvider)
public static javax.swing.JPasswordField createPasswordField(java.lang.String theType, PropertyProvider thePropProvider)
JPasswordField
and initializes it by using the
given type. If the type is not found by the provider, a default field
is returned.
theType
- the data type keythePropProvider
- the provider that determines the file(s) to look
at for properties
java.lang.IllegalArgumentException
- if either input parameter is
null
createTextField(String, PropertyProvider)
public static TextFieldWidget createTextField(java.lang.String theType)
TextFieldWidget
and initializes it by using the
given type. If the type is not found by the provider, a default textfield
is returned. The default provider is used.
theType
- the data type key
java.lang.IllegalArgumentException
- if input parameter is null
createTextField(String, PropertyProvider)
public static TextFieldWidget createTextField(java.lang.String theType, PropertyProvider thePropProvider)
TextFieldWidget
and initializes by using the given
type. If the type is not found by the provider, a default textfield
is returned. A typical type entry in a properties file would like like
this:type.heapsize.length.min="1" type.heapsize.length.max="4" type.heapsize.cols=get("type.heapsize.length.max") type.heapsize.required="true" type.heapsize.validchars="0-9" #type.heapsize.invalidchars=""
theType
- the data type keythePropProvider
- the provider that determines the file(s) to look
at for properties
java.lang.IllegalArgumentException
- if either input parameter is
null
public static TextFieldWidget createTextField(java.lang.String theType, java.lang.String theKey, PropertyProvider thePropProvider)
TextFieldWidget
and initializes by using the given
type. Also, properties are set based on the given key. If the type is not
found by the provider, a default textfield is returned.
theType
- the data type keytheKey
- the properties key to use to set JavaBean propertiesthePropProvider
- the provider that determines the file(s) to look
at for properties
java.lang.IllegalArgumentException
- if any input parameter is
null
createTextField(String, PropertyProvider)
,
setProperties(String, JComponent, PropertyProvider)
public static void setProperties(java.lang.String theKey, javax.swing.JComponent theComponent, PropertyProvider thePropProvider)
theKey
- the properties key to used as a prefix to set JavaBean
propertiestheComponent
- the component whose properties are being setthePropProvider
- the provider that determines the file(s) to look
at for properties
java.lang.IllegalArgumentException
- if any input parameter is
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |