|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.planetalia.dynject.sources.SwingSource
public class SwingSource
Creates a source that reads its values from the fields of a Swing or AWT form. The name of each
property is taken to be the name1 of some component in a Swing form, whereas the value of the
property is read from the user-editable property of that component. Depending on the component, that
property varies. Currently, the following components are supported:
| Class | Property used |
| javax.swing.text.JTextComponent | text |
| javax.swing.JColorChooser | color |
| javax.swing.JComboBox | selectedItem |
| javax.swing.JFileChooser | selectedFile.absolutePath |
| javax.swing.JLabel | text |
| javax.swing.JComboBox | selectedItem |
| javax.swing.JList | selectedValue |
| javax.swing.JSlider | value |
| javax.swing.JSpinner | value |
| javax.swing.AbstractButton | selected |
| javax.swing.JScrollBar | value |
| javax.swing.JProgressBar | value |
| java.awt.TextComponent | text |
| java.awt.Scrollbar | value |
| java.awt.Checkbox | state |
| java.awt.Label | text |
| java.awt.Choice | selectedItem |
| Constructor Summary | |
|---|---|
SwingSource(java.awt.Container container)
Creates a Swing source using the specified container as property source |
|
| Method Summary | |
|---|---|
protected java.awt.Component |
findComponent(java.lang.String propertyName)
Locates the component that is associated to the specified property name. |
ClassPreferences |
getPropertyClass(java.lang.String propertyName)
Returns the class preferences for a property |
java.util.Set |
getPropertyNames()
Returns the set of all existing properties at the time of invocation. |
java.lang.Object |
getValue(java.lang.String propertyName)
Provides the value of a specific property |
boolean |
propertyExists(java.lang.String propertyName)
Checks whether a specific property exists. |
void |
setValue(java.lang.String propertyName,
java.lang.Object value)
Sets the value of a specific property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwingSource(java.awt.Container container)
container - Container to use| Method Detail |
|---|
protected java.awt.Component findComponent(java.lang.String propertyName)
propertyName - Requested property name
public java.lang.Object getValue(java.lang.String propertyName)
IValueSource
getValue in interface IValueSourcepropertyName - Name of the requested property. Assumed to exist.
public boolean propertyExists(java.lang.String propertyName)
IValueSource
propertyExists in interface IValueSourcepropertyName - Name of the requested property
public ClassPreferences getPropertyClass(java.lang.String propertyName)
IValueSource
getPropertyClass in interface IValueSourcepropertyName - Name of the property
public java.util.Set getPropertyNames()
IValueSource
getPropertyNames in interface IValueSource
public void setValue(java.lang.String propertyName,
java.lang.Object value)
IValueSource
setValue in interface IValueSourcepropertyName - Name of the requested property.value - Property value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||