QJCC homepage

biz.chitec.quarterback.swing
Class PropertiesEditorXML.PropertyControlElement

java.lang.Object
  extended bybiz.chitec.quarterback.swing.PropertiesEditorXML.PropertyControlElement
Enclosing class:
PropertiesEditorXML

private class PropertiesEditorXML.PropertyControlElement
extends java.lang.Object

Holder of one widget to control a property. Contains one Component which can be received by getComponent(), knows how to set and get the values to and from it. This class is streamlined for the creation process with an XML file in the background. It is created with the <item>-tag's attributes, it can receive additional information from the <alternatives> or <locale> tag, and it creates itself finally during the first getComponent() call which is done in the processing of the </item> end tag.

After being created, the only explicit interaction with the class happens to the load() and store() method.


Field Summary
private  java.util.Map attribs
           
private  java.awt.Component c
           
private  java.lang.String name
           
private  java.lang.String property
           
private  int type
           
 
Constructor Summary
PropertiesEditorXML.PropertyControlElement(java.util.Map startattribs)
           
 
Method Summary
 void addAlternative(java.lang.String key, java.lang.String value)
           
 void addLocale(java.lang.String language, java.lang.String country, java.lang.String variant)
           
private  boolean getBooleanAttrib(java.lang.String key, boolean defaultvalue)
           
 java.awt.Component getComponent()
          Creates the component which represents the ControlElement in the GUI
private  int getIntAttrib(java.lang.String key, int defaultvalue)
           
 java.lang.String getName()
           
 java.lang.String getProperty()
           
private  java.lang.String getRBString(java.lang.String addkey)
           
private  java.lang.String getStringAttrib(java.lang.String key, java.lang.String defaultvalue)
           
 int getType()
          Return the type of the control
 void loadToElement(java.util.Map m, boolean forceset)
           
 void setAllLanguages()
           
 void setAllLocales()
           
 void setCustomCombo(java.util.List content)
          Sets the selectable alternatives for a custom combo field.
 void storeToMap(java.util.Map m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c

private java.awt.Component c

type

private int type

name

private java.lang.String name

property

private java.lang.String property

attribs

private java.util.Map attribs
Constructor Detail

PropertiesEditorXML.PropertyControlElement

public PropertiesEditorXML.PropertyControlElement(java.util.Map startattribs)
Method Detail

getRBString

private java.lang.String getRBString(java.lang.String addkey)

addAlternative

public void addAlternative(java.lang.String key,
                           java.lang.String value)

addLocale

public void addLocale(java.lang.String language,
                      java.lang.String country,
                      java.lang.String variant)

setAllLocales

public void setAllLocales()

setAllLanguages

public void setAllLanguages()

setCustomCombo

public void setCustomCombo(java.util.List content)
Sets the selectable alternatives for a custom combo field. Should be called before the data to show is loaded. If called afterwards, tries to preserve selection.

Parameters:
content - The selectable alternatives. Will be shown in given order.

getIntAttrib

private int getIntAttrib(java.lang.String key,
                         int defaultvalue)

getBooleanAttrib

private boolean getBooleanAttrib(java.lang.String key,
                                 boolean defaultvalue)

getStringAttrib

private java.lang.String getStringAttrib(java.lang.String key,
                                         java.lang.String defaultvalue)

getComponent

public java.awt.Component getComponent()
Creates the component which represents the ControlElement in the GUI


getType

public int getType()
Return the type of the control


getName

public java.lang.String getName()

getProperty

public java.lang.String getProperty()

loadToElement

public void loadToElement(java.util.Map m,
                          boolean forceset)

storeToMap

public void storeToMap(java.util.Map m)

QJCC homepage