Mp3dings 
20100427

de.mospace.swing
Interface IOPane.History

All Known Implementing Classes:
IOPane.VectorHistory
Enclosing class:
IOPane

public static interface IOPane.History

Minimum requirements for a command line history for the input field of an IOPane. You can navigate this history step by step using the next() and previous() methods.


Method Summary
 void add(String item)
          Adds the specified item to this history.
 void clear()
          Removes all items from this history.
 ActionListener getAddListener()
          Returns the ActionListener that adds items to this history.
 int getLength()
          Returns the maximum number of items this history can hold.
 String next()
          If there was no call to next() after the last add(java.lang.String) this method will return the last item added to this history.
 String previous()
          Returns the item added after the item returned by the last call to next() or previous().
 void resetPointer()
          Resets the current position in this history such that the next item returned by next() will be the item last added or null if no such item exists.
 void setLength(int maxitems)
          Sets the maximum number of items this history can hold.
 

Method Detail

getAddListener

ActionListener getAddListener()
Returns the ActionListener that adds items to this history. It should usually add(java.lang.String) the value returned by ActionEvent.getActionCommand().

Returns:
an action listener that adds new items to this history

setLength

void setLength(int maxitems)
Sets the maximum number of items this history can hold.

Parameters:
maxitems - the maximum number of items
See Also:
getLength()

getLength

int getLength()
Returns the maximum number of items this history can hold.

Returns:
the maximum number of items
See Also:
setLength(int)

add

void add(String item)
Adds the specified item to this history. If item is not null the next call to next() must return item.

Parameters:
item - the item to add

clear

void clear()
Removes all items from this history.


next

String next()
If there was no call to next() after the last add(java.lang.String) this method will return the last item added to this history. Otherwise, it returns the item added before the item returned by the last call to next() or previous(). It returns null if no such item exists.

Returns:
the next item in this history or null at its end

previous

String previous()
Returns the item added after the item returned by the last call to next() or previous(). Even if no such item exists this method must return a non-null value, preferably the empty string.

Returns:
the previous item in this history

resetPointer

void resetPointer()
Resets the current position in this history such that the next item returned by next() will be the item last added or null if no such item exists.


Mp3dings 
20100427