JPanel testPanel = new Panel(); // create parent panel
testPanel.setLayout(new BoxLayout(testPanel, BoxLayout.PAGE_AXIS));
GUIPropertyString name = new GUIPropertyString("Name", "Anne");
testPanel.add(name.getPropertyPanel()); // add one property
GUIPropertyString city = new GUIPropertyString("City", "Eindhoven");
testPanel.add(city.getPropertyPanel()); // add another property
return testPanel;
- See Also:
getValue
,
getPropertyPanel
Constructor Summary |
GUIPropertyStringArea(java.lang.String name,
java.lang.String defaultValue)
Creates a boolean property without a discription and notification. |
GUIPropertyStringArea(java.lang.String name,
java.lang.String defaultValue,
GuiNotificationTarget target)
Creates a boolean property without a discription. |
GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue)
Creates a boolean property without notification. |
GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target)
Creates a boolean property. |
GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target,
int width)
Creates a boolean property. |
Method Summary |
void |
changedUpdate(javax.swing.event.DocumentEvent e)
|
javax.swing.JPanel |
getPropertyPanel()
Creates GUI panel containg this property, ready to display in
some settings dialog. |
java.lang.String |
getValue()
The method to be invoked when the value of this property is
to be used. |
void |
insertUpdate(javax.swing.event.DocumentEvent e)
|
void |
removeUpdate(javax.swing.event.DocumentEvent e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myName
protected java.lang.String myName
myDescription
protected java.lang.String myDescription
myValue
protected java.lang.String myValue
myWidth
protected int myWidth
myTarget
protected GuiNotificationTarget myTarget
myTextField
protected javax.swing.JTextArea myTextField
GUIPropertyStringArea
public GUIPropertyStringArea(java.lang.String name,
java.lang.String defaultValue)
- Creates a boolean property without a discription and notification.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this property
GUIPropertyStringArea
public GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue)
- Creates a boolean property without notification.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this property
GUIPropertyStringArea
public GUIPropertyStringArea(java.lang.String name,
java.lang.String defaultValue,
GuiNotificationTarget target)
- Creates a boolean property without a discription.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changes
GUIPropertyStringArea
public GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target)
- Creates a boolean property.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changes
GUIPropertyStringArea
public GUIPropertyStringArea(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target,
int width)
- Creates a boolean property.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changeswidth
- a custom width may be specified (default value is 100 otherwise)
insertUpdate
public void insertUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
insertUpdate
in interface javax.swing.event.DocumentListener
changedUpdate
public void changedUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
changedUpdate
in interface javax.swing.event.DocumentListener
removeUpdate
public void removeUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
removeUpdate
in interface javax.swing.event.DocumentListener
getValue
public java.lang.String getValue()
- The method to be invoked when the value of this property is
to be used.
- Returns:
- the current value of this property
getPropertyPanel
public javax.swing.JPanel getPropertyPanel()
- Creates GUI panel containg this property, ready to display in
some settings dialog.
- Returns:
- the graphical panel representing this property