|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.swing.TableHeaderConfigurationModel
Generalized table header configuration Stores all possible table columns and configurations of which columns should be shown. Allows to create new configurations and to change them. Manages all the configurations. The model manages several table header lists: One is the so-called current configuration which is the one actually used by the JTable. the other ones are named and stored seperately. They can be selected as current one by simple click. TableHeaderConfigurationModel supports persistance in an explicit way: Via getConfiguration and putConfiguration the complete configuration can be stored and read into and from a String. The stored information is independent from the actual set of possible headers. So, if programmatically new headers are added to the list (or some are removed), the stored persistance state will be evaluated in a sensible way, anyway. TableHeaderConfigurationModel communicates via PropertyChangeEvents with its environment. It does not feature any user interface. Normally, it is used in conjunction with a TableHeaderConfigurator instance.
TableHeaderConfigurator
Field Summary | |
private java.lang.String[] |
allheaders
|
private java.util.List |
configurations
|
private java.util.List |
currentconfig
|
private java.lang.String[] |
currentconfigasarray
|
private java.util.Map |
currentlockedwidth
|
private java.lang.String[] |
lastfiredconfig
|
private java.util.Map |
lastfiredlockedwidth
|
private java.beans.PropertyChangeSupport |
pcs
|
Constructor Summary | |
TableHeaderConfigurationModel(java.lang.String[] allheadersx)
Initialize model with complete header list. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener. |
void |
addPropertyChangeListener(java.lang.String prop,
java.beans.PropertyChangeListener listener)
Add a property change listener for a certain property. |
protected void |
fireCurrentConfiguration()
fires a change event in case the current configuration changes |
protected void |
fireCurrentLockedWidth()
fires a change event in case the current locked width changes |
java.lang.String[] |
getAllHeaders()
Returns the complete header list as it has been passed during initialization |
java.lang.String |
getConfiguration()
Create textual representation of complete inner state in a way feasible for object persistance |
java.util.Set |
getCurrentConfigAsSet()
Returns the current configuration as Set |
java.lang.String[] |
getCurrentConfiguration()
Returns the current configuration as array of Strings |
java.util.Map |
getCurrentLockedWidth()
Returns the current configuration as array of Strings |
private java.lang.StringBuffer |
listToString(java.util.Collection config,
java.util.Map cache,
java.lang.StringBuffer sb)
Creates textual representation of one header configuration. |
private java.lang.StringBuffer |
mapToString(java.util.Map config,
java.util.Map cache,
java.lang.StringBuffer sb)
Creates textual representation of one header configuration. |
void |
moveCurrentColumn(int sourcecolumn,
int targetcolumn)
Moves one column in the current configuration from one position to another |
void |
putConfiguration(java.lang.String s)
Create inner state from a persistance storage. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener. |
void |
removePropertyChangeListener(java.lang.String prop,
java.beans.PropertyChangeListener listener)
Remove a property change listener for a certain property. |
void |
setInCurrentConfig(java.lang.String columnname,
boolean selected)
Adds or removes one column to or from the current configuration. |
void |
setInCurrentLockedWidth(java.lang.String columnname,
int width)
|
private java.util.List |
stringToList(java.util.StringTokenizer str,
java.util.Map cache,
java.util.Set allheaderset)
Recreates one header configuration from persistance storage string |
private java.util.Map |
stringToMap(java.util.StringTokenizer str,
java.util.Map cache,
java.util.Set allheaderset)
Recreates one header configuration from persistance storage string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String[] allheaders
private java.lang.String[] lastfiredconfig
private java.util.Map lastfiredlockedwidth
private java.lang.String[] currentconfigasarray
private java.util.List currentconfig
private java.util.Map currentlockedwidth
private java.util.List configurations
private java.beans.PropertyChangeSupport pcs
Constructor Detail |
public TableHeaderConfigurationModel(java.lang.String[] allheadersx)
allheadersx
- String array containing all headers with can possibly be shown.Method Detail |
private java.lang.StringBuffer listToString(java.util.Collection config, java.util.Map cache, java.lang.StringBuffer sb)
private java.lang.StringBuffer mapToString(java.util.Map config, java.util.Map cache, java.lang.StringBuffer sb)
public java.lang.String getConfiguration()
private java.util.List stringToList(java.util.StringTokenizer str, java.util.Map cache, java.util.Set allheaderset)
private java.util.Map stringToMap(java.util.StringTokenizer str, java.util.Map cache, java.util.Set allheaderset)
public void putConfiguration(java.lang.String s)
s
- String containing the inner state, normally created via getConfiguration()public void moveCurrentColumn(int sourcecolumn, int targetcolumn)
sourcecolumn
- targetcolumn
- public void setInCurrentConfig(java.lang.String columnname, boolean selected)
columnname
- Name of the column to add or removeselected
- Flag to indicate addition or removalpublic void setInCurrentLockedWidth(java.lang.String columnname, int width)
public java.lang.String[] getAllHeaders()
public java.lang.String[] getCurrentConfiguration()
public java.util.Map getCurrentLockedWidth()
public java.util.Set getCurrentConfigAsSet()
protected void fireCurrentConfiguration()
protected void fireCurrentLockedWidth()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String prop, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String prop, java.beans.PropertyChangeListener listener)
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |