org.w3c.jwput.gui
Class History

java.lang.Object
  |
  +--org.w3c.jwput.gui.History

public class History
extends java.lang.Object

History is a set of String (associated to a JComboBox)


Field Summary
protected  int count
           
static java.lang.String COUNT_P
           
protected  java.io.File file
           
protected  java.util.LinkedList list
           
protected  int maxsize
           
protected  java.lang.String title
           
 
Constructor Summary
History(int maxsize, java.lang.String title, java.io.File file)
           
 
Method Summary
 void add(java.lang.String object)
          Add this object to the History and remove the older element of the History if maxsize is reached.
 void addHistoryListener(HistoryListener listener)
          Add an HistoryListener
protected  void fireItemAddedHistoryEvent(java.lang.String item)
           
protected  void fireItemMovedFirstHistoryEvent(java.lang.String item)
           
protected  void fireItemRemovedHistoryEvent(java.lang.String item)
           
 java.lang.Object[] getHistory()
          Get the history (newer first)
 void initialize(javax.swing.JComboBox combo)
          Put the History elements in the given ComboBox.
 History load()
          Load the history
 void removeHistoryListener(HistoryListener listener)
          Remove an HistoryListener
 History save()
          Save the current history
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COUNT_P

public static final java.lang.String COUNT_P

list

protected java.util.LinkedList list

maxsize

protected int maxsize

count

protected int count

title

protected java.lang.String title

file

protected java.io.File file
Constructor Detail

History

public History(int maxsize,
               java.lang.String title,
               java.io.File file)
Method Detail

initialize

public void initialize(javax.swing.JComboBox combo)
Put the History elements in the given ComboBox.
Parameters:
combo - the JComboBox to initialize

addHistoryListener

public void addHistoryListener(HistoryListener listener)
Add an HistoryListener
Parameters:
listener - the History listener
See Also:
HistoryListener

removeHistoryListener

public void removeHistoryListener(HistoryListener listener)
Remove an HistoryListener
Parameters:
listener - the History listener
See Also:
HistoryListener

fireItemMovedFirstHistoryEvent

protected void fireItemMovedFirstHistoryEvent(java.lang.String item)

fireItemAddedHistoryEvent

protected void fireItemAddedHistoryEvent(java.lang.String item)

fireItemRemovedHistoryEvent

protected void fireItemRemovedHistoryEvent(java.lang.String item)

add

public void add(java.lang.String object)
Add this object to the History and remove the older element of the History if maxsize is reached.

getHistory

public java.lang.Object[] getHistory()
Get the history (newer first)
Returns:
an Object array

save

public History save()
             throws java.io.IOException
Save the current history
Throws:
java.io.IOException - if an IO error occured

load

public History load()
             throws java.io.IOException
Load the history
Throws:
java.io.IOException - if an IO error occured