jmathlib.ui.swing
Class CommandHistoryManager

java.lang.Object
  extended by jmathlib.ui.swing.CommandHistoryManager

public class CommandHistoryManager
extends java.lang.Object


Nested Class Summary
 class CommandHistoryManager.Command
           
 class CommandHistoryManager.Session
           
static interface CommandHistoryManager.SessionCommandListener
           
 
Field Summary
private static int AFTER_LAST
           
private  java.util.ArrayList<CommandHistoryManager.Session> allSessions
           
private static java.lang.String COMMAND_NODENAME
           
private  CommandHistoryManager.Session currentSession
           
private static java.lang.String DATE_ATTRNAME
           
private static CommandHistoryManager DEFAULT_INSTANCE
           
private  java.util.ArrayList<CommandHistoryManager.SessionCommandListener> listeners
           
private static java.lang.String ROOT_NODENAME
           
private  int selectedIndex
           
private  int selectedSession
           
private static java.lang.String SERIALIZED_FILENAME
           
private static java.lang.String SESSION_NODENAME
           
 
Constructor Summary
private CommandHistoryManager()
           
 
Method Summary
 void addChangeListener(CommandHistoryManager.SessionCommandListener listener)
           
 void addCommand(java.lang.String command)
           
private  void addSession(CommandHistoryManager.Session s)
           
 void clearCurrentSession()
           
 java.lang.String currentCommand()
           
private  void fireCommandAdded(CommandHistoryManager.Command command)
           
static CommandHistoryManager getDefaultInstance()
           
private static org.w3c.dom.Element[] getElements(org.w3c.dom.Element elem)
           
 CommandHistoryManager.Session getSession(int index)
           
 int getSessionCount()
           
 int indexOfSession(CommandHistoryManager.Session session)
           
private  void loadSessionHistory()
           
 java.lang.String nextCommand()
           
 java.lang.String prevCommand()
           
 void removeChangeListener(CommandHistoryManager.SessionCommandListener listener)
           
 void resetToLastCommand()
           
private  CommandHistoryManager.Session startCurrentSession()
           
 void writeSessionHistory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INSTANCE

private static CommandHistoryManager DEFAULT_INSTANCE

AFTER_LAST

private static int AFTER_LAST

selectedSession

private int selectedSession

selectedIndex

private int selectedIndex

currentSession

private CommandHistoryManager.Session currentSession

allSessions

private java.util.ArrayList<CommandHistoryManager.Session> allSessions

SERIALIZED_FILENAME

private static final java.lang.String SERIALIZED_FILENAME
See Also:
Constant Field Values

ROOT_NODENAME

private static final java.lang.String ROOT_NODENAME
See Also:
Constant Field Values

SESSION_NODENAME

private static final java.lang.String SESSION_NODENAME
See Also:
Constant Field Values

DATE_ATTRNAME

private static final java.lang.String DATE_ATTRNAME
See Also:
Constant Field Values

COMMAND_NODENAME

private static final java.lang.String COMMAND_NODENAME
See Also:
Constant Field Values

listeners

private java.util.ArrayList<CommandHistoryManager.SessionCommandListener> listeners
Constructor Detail

CommandHistoryManager

private CommandHistoryManager()
Method Detail

addSession

private void addSession(CommandHistoryManager.Session s)

addCommand

public void addCommand(java.lang.String command)

nextCommand

public java.lang.String nextCommand()

prevCommand

public java.lang.String prevCommand()

currentCommand

public java.lang.String currentCommand()

resetToLastCommand

public void resetToLastCommand()

clearCurrentSession

public void clearCurrentSession()

startCurrentSession

private CommandHistoryManager.Session startCurrentSession()

fireCommandAdded

private void fireCommandAdded(CommandHistoryManager.Command command)

addChangeListener

public void addChangeListener(CommandHistoryManager.SessionCommandListener listener)

removeChangeListener

public void removeChangeListener(CommandHistoryManager.SessionCommandListener listener)

getSessionCount

public int getSessionCount()

getSession

public CommandHistoryManager.Session getSession(int index)

indexOfSession

public int indexOfSession(CommandHistoryManager.Session session)

getDefaultInstance

public static CommandHistoryManager getDefaultInstance()

loadSessionHistory

private void loadSessionHistory()

writeSessionHistory

public void writeSessionHistory()

getElements

private static org.w3c.dom.Element[] getElements(org.w3c.dom.Element elem)

FOOTER

BOTTOM