de.jaret.util.ui.timebars.addon
Class ViewstateSaver

java.lang.Object
  extended by de.jaret.util.ui.timebars.addon.ViewstateSaver
All Implemented Interfaces:
IViewstateSaver

public class ViewstateSaver
extends java.lang.Object
implements IViewstateSaver

Implementation of the viewstate saver for a timebarviewer. Saves and restores

Version:
$Id: ViewstateSaver.java 664 2007-12-10 21:40:08Z kliem $
Author:
kliem

Constructor Summary
ViewstateSaver()
           
 
Method Summary
static ViewstateSaver getInstance()
          The ViewStateSaver can be used as a singleton.
 void restoreViewstate(de.jaret.util.ui.timebars.swt.TimeBarViewer timeBarViewer, IHierarchyIdService idService, java.lang.String id, org.eclipse.ui.IMemento memento)
          Restore the viewstate.
 void saveViewstate(de.jaret.util.ui.timebars.swt.TimeBarViewer timeBarViewer, IHierarchyIdService idService, java.lang.String id, org.eclipse.ui.IMemento memento)
          Save the viewstate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewstateSaver

public ViewstateSaver()
Method Detail

getInstance

public static ViewstateSaver getInstance()
The ViewStateSaver can be used as a singleton.

Returns:
instance

restoreViewstate

public void restoreViewstate(de.jaret.util.ui.timebars.swt.TimeBarViewer timeBarViewer,
                             IHierarchyIdService idService,
                             java.lang.String id,
                             org.eclipse.ui.IMemento memento)
Restore the viewstate. Will not fail if no state can be found in the memento.

Specified by:
restoreViewstate in interface IViewstateSaver
Parameters:
timeBarViewer - viewer to restore state of
idService - HierarchyIdService needed when handling hierarchical models. May be null when dealing with a flat model
id - id of a child memento to read from. May be null.
memento - memento to read from

saveViewstate

public void saveViewstate(de.jaret.util.ui.timebars.swt.TimeBarViewer timeBarViewer,
                          IHierarchyIdService idService,
                          java.lang.String id,
                          org.eclipse.ui.IMemento memento)
Save the viewstate. Previously saved state will be overwritten.

Specified by:
saveViewstate in interface IViewstateSaver
Parameters:
timeBarViewer - viewer to save state of
idService - HierarchyIdService needed when handling hierarchical models. May be null when dealing with a flat model
id - id used to create a child memento when not null
memento - memento to write to


Copyright © 2012. All Rights Reserved.