frysk.gui.sessions
Class Session

java.lang.Object
  extended by frysk.gui.monitor.GuiObject
      extended by frysk.gui.sessions.Session
All Implemented Interfaces:
SaveableXXX

public class Session
extends GuiObject

A Session object is used to hold and save user preferences with respect to a debug session.


Nested Class Summary
static class Session.SessionType
           
 
Field Summary
 Session.SessionType sessionType
           
 
Fields inherited from class frysk.gui.monitor.GuiObject
propertiesChanged
 
Constructor Summary
Session()
          Creates a new empty session object, with an empty list processes.
Session(Session other)
          Creates a new session, which is clone of the session that is passed in as a paraemter
Session(String name, String toolTip)
          Creates a new empty session object, with an empty list processes.
 
Method Summary
 void addDebugProcess(DebugProcess process)
          Add a debug process to this session
 void addDefaultObservers()
           
 void addGuiProc(GuiProc guiProc)
          Searches to find if there is already a DebugProcess representing the executable of the given GuiProc.
 void addObserver(ObserverRoot observer)
           
 boolean areProcsAdded()
           
 void clearProcesses()
           
 GuiObject getCopy()
           
 ObservableLinkedList getObservers()
           
 ObservableLinkedList getProcesses()
          Return a list of debug process that are contained within this session object
 Session.SessionType getSessoinType()
           
 void load(Element node)
          To load a stored property one does this: String someString = node.getAttributeValue("someString"); To load @link frysk.gui.monitor.SaveableXXX one gets the appropriet node and tells that object to load itself from that node.
 void removeDebugProcess(DebugProcess process)
          Remove a debug process from this session.
 void removeGuiProc(GuiProc proc)
           
 void removeObserver(ObserverRoot observer)
           
 void save(Element node)
          Save object to the given node Saving Conventions: If this object has a property such as a String, char, int, etc, that is saved by using node.setAttribute("someProperty", someProperty); If this object contains composing @link frysk.gui.monitor.SaveableXXX then a node is created for that and that object is told to save itself to that node.
 void setName(String name)
           
 void setProcsAdded(boolean procsAdded)
           
 void setSessionType(Session.SessionType sessionType)
           
 void startSession()
           
 
Methods inherited from class frysk.gui.monitor.GuiObject
dontSaveObject, doSaveObject, getName, getSummary, getToolTip, setSummay, setToolTip, shouldSaveObject, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sessionType

public Session.SessionType sessionType
Constructor Detail

Session

public Session()
Creates a new empty session object, with an empty list processes. Debug processes should be added to this session.


Session

public Session(Session other)
Creates a new session, which is clone of the session that is passed in as a paraemter

Parameters:
other - - the session you want this session to clone.

Session

public Session(String name,
               String toolTip)
Creates a new empty session object, with an empty list processes. Debug processes should be added to this session.

Parameters:
name - - the name of the session
toolTip - - the tool-tip or additional associative information.
Method Detail

addDefaultObservers

public void addDefaultObservers()

setName

public void setName(String name)
Overrides:
setName in class GuiObject

addObserver

public void addObserver(ObserverRoot observer)

removeObserver

public void removeObserver(ObserverRoot observer)

addDebugProcess

public void addDebugProcess(DebugProcess process)
Add a debug process to this session

Parameters:
process - - The Debug Process that is to be added.

removeDebugProcess

public void removeDebugProcess(DebugProcess process)
Remove a debug process from this session.

Parameters:
process - - a reference to the debug process that is to be removed.

addGuiProc

public void addGuiProc(GuiProc guiProc)
Searches to find if there is already a DebugProcess representing the executable of the given GuiProc. If so the proc is added to that DebugProcess. Otherwise a new DebugProcess is created and added to the session.

Parameters:
guiProc -

removeGuiProc

public void removeGuiProc(GuiProc proc)
Parameters:
proc -

getCopy

public GuiObject getCopy()

getProcesses

public ObservableLinkedList getProcesses()
Return a list of debug process that are contained within this session object

Returns:
ObservableLinkedList of Debug Processes.

clearProcesses

public void clearProcesses()

startSession

public void startSession()

getObservers

public ObservableLinkedList getObservers()

setProcsAdded

public void setProcsAdded(boolean procsAdded)

areProcsAdded

public boolean areProcsAdded()

getSessoinType

public Session.SessionType getSessoinType()

setSessionType

public void setSessionType(Session.SessionType sessionType)

load

public void load(Element node)
Description copied from interface: SaveableXXX
To load a stored property one does this: String someString = node.getAttributeValue("someString"); To load @link frysk.gui.monitor.SaveableXXX one gets the appropriet node and tells that object to load itself from that node. Example: Element filtersNode = node.getChild("filtersList"); this.filtersList.load(filtersNode);

Specified by:
load in interface SaveableXXX
Overrides:
load in class GuiObject

save

public void save(Element node)
Description copied from interface: SaveableXXX
Save object to the given node Saving Conventions: If this object has a property such as a String, char, int, etc, that is saved by using node.setAttribute("someProperty", someProperty); If this object contains composing @link frysk.gui.monitor.SaveableXXX then a node is created for that and that object is told to save itself to that node. Example: Element filtersNode = new Element("filtersList"); this.filtersList.save(filtersNode); node.addContent(filtersNode); Be careful some times one wants to save the objects name rather than the object itself, and then use the name to later recreate that object via a managers. Like observers for instance. Perhaps objects such as these should be smart enough to use a manager to save/load themselves, that way an api client doesnt have to worry ... one day :).

Specified by:
save in interface SaveableXXX
Overrides:
save in class GuiObject