Together Workflow Editor 3.0-1 API

org.enhydra.jawe
Class XMLElementChoiceButton.FilteredListModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byorg.enhydra.jawe.XMLElementChoiceButton.FilteredListModel
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.event.DocumentListener, java.util.EventListener, javax.swing.ListModel, java.io.Serializable
Enclosing class:
XMLElementChoiceButton

private class XMLElementChoiceButton.FilteredListModel
extends javax.swing.AbstractListModel
implements javax.swing.event.DocumentListener, java.awt.event.ActionListener

This class is the core junction between the list of element, the filter textfield and the rendering of JList component


Field Summary
private  java.util.ArrayList filteredList
           
private  java.util.ArrayList fullList
           
private  java.lang.String key
           
private  java.util.ArrayList rejectedList
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
private XMLElementChoiceButton.FilteredListModel()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          triggered when action is performed in TextField.
 void changedUpdate(javax.swing.event.DocumentEvent e)
          Do nothing
 void filter(java.lang.String key)
          updates model according to filter key
 java.lang.Object getElementAt(int index)
           
 int getFilterSize()
           
 int getSize()
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
          Handles updates in Textfield, requires to redo filtering and updates filter accordingly
private  boolean match(java.lang.String key, org.enhydra.shark.xpdl.XMLElement element)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
          Handles updates in Textfield, requires to redo filtering and updates filter accordingly
 void setFilteredList(java.lang.Object[] list)
          This is mainly for convenience with output from map.entrySet.toArray() that this method accept an Object[] parameter.
private  boolean splitAndMatch(java.lang.String key, org.enhydra.shark.xpdl.XMLElement element)
           
private  void updateFilter(javax.swing.text.Document doc)
           
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fullList

private java.util.ArrayList fullList

filteredList

private java.util.ArrayList filteredList

rejectedList

private java.util.ArrayList rejectedList

key

private java.lang.String key
Constructor Detail

XMLElementChoiceButton.FilteredListModel

private XMLElementChoiceButton.FilteredListModel()
Method Detail

setFilteredList

public void setFilteredList(java.lang.Object[] list)
This is mainly for convenience with output from map.entrySet.toArray() that this method accept an Object[] parameter. The content of array should be Map.Entry where key is a String and value is an XMLElement

Parameters:
list - the list of element to filter from in this model

getFilterSize

public int getFilterSize()

getSize

public int getSize()
Specified by:
getSize in interface javax.swing.ListModel

getElementAt

public java.lang.Object getElementAt(int index)
Specified by:
getElementAt in interface javax.swing.ListModel

match

private boolean match(java.lang.String key,
                      org.enhydra.shark.xpdl.XMLElement element)

splitAndMatch

private boolean splitAndMatch(java.lang.String key,
                              org.enhydra.shark.xpdl.XMLElement element)

filter

public void filter(java.lang.String key)
updates model according to filter key


updateFilter

private void updateFilter(javax.swing.text.Document doc)

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Do nothing

Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Handles updates in Textfield, requires to redo filtering and updates filter accordingly

Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - DocumentEvent

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Handles updates in Textfield, requires to redo filtering and updates filter accordingly

Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - DocumentEvent

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
triggered when action is performed in TextField. This mean a 'enter' from textfield and we select a specific elt in JList if there is only one match if filtering

Specified by:
actionPerformed in interface java.awt.event.ActionListener

Together Workflow Editor 3.0-1 API