org.grinvin.workspace

Interface Wrapper<C>

Known Implementing Classes:
ConjecturingWindowWrapper, DefaultWindowWrapper<W,extends,Window>, EditorWindowWrapper, EditorWindowWrapper_1_0, GraphBrowserWindowWrapper, GrinvinWindowWrapper, GrinvinWindowWrapper_1_0, LoggingWindowWrapper, LoggingWindowWrapper_1_0, WorksheetWindowWrapper

public interface Wrapper<C>

An object of this type manages the life cycle of one or more subcomponents of the GrInVin system, of type . Wrappers are typically stateless objects one instance of which can be reused to manage different component objects of the same type .

Method Summary

C
create()
Create the subcomponent(s) managed by this wrapper.
void
dispose(C component)
Dispose of the given subcomponent.
String
getElementName()
Return the XML-element name by which this type of wrapper is identified within its parent.
C
load(Element element, SectionLoader sloader)
Load the subcomponent(s) managed by this wrapper from a persistent work space.
void
save(C component, Element parent, SectionSaver ssaver)
Save the given subcomponent.

Method Details

create

public C create()
Create the subcomponent(s) managed by this wrapper. This is typically called when the system is started with no persisted workspace available.
Returns:
the newly created subcomponent

dispose

public void dispose(C component)
Dispose of the given subcomponent. Typically disposes windows, clears caches, etc.

getElementName

public String getElementName()
Return the XML-element name by which this type of wrapper is identified within its parent.

load

public C load(Element element,
              SectionLoader sloader)
            throws IOException
Load the subcomponent(s) managed by this wrapper from a persistent work space. Will only be called after dispose(C) was called on the same object.
Parameters:
element - JDOM element which stores extra information about this wrapper.
Returns:
the object which was loaded

save

public void save(C component,
                 Element parent,
                 SectionSaver ssaver)
            throws IOException
Save the given subcomponent.
Parameters:
component - Subcomponent to be saved
parent - parent JDOM element into which the JDOM element(s) for this wrapper must be stored.