1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package de.jaret.util.ui.timebars.addon;
21
22 import org.eclipse.ui.IMemento;
23
24 import de.jaret.util.ui.timebars.swt.TimeBarViewer;
25
26 /***
27 * Interface for a service saving and restoring the viewstate of a timebarviewer. When dealing with hierarchical
28 * models a HierarchyIdService is needed for identifying the nodes.
29 *
30 * @author kliem
31 * @version $Id: IViewstateSaver.java 340 2007-04-02 21:52:03Z olk $
32 */
33 public interface IViewstateSaver {
34 /***
35 * Save the viewstate. Previously saved state will be overwritten.
36 *
37 * @param timeBarViewer viewer to save state of
38 * @param idService HierarchyIdService needed when handling hierarchical models. May be <code>null</code> when
39 * dealing with a flat model
40 * @param id id used to create a child memento when not <code>null</code>
41 * @param memento memento to write to
42 */
43 void saveViewstate(TimeBarViewer timeBarViewer, IHierarchyIdService idService, String id, IMemento memento);
44 /***
45 * Restore the viewstate. Will not fail if no state can be found in the memento.
46 *
47 * @param timeBarViewer viewer to restore state of
48 * @param idService HierarchyIdService needed when handling hierarchical models. May be <code>null</code> when
49 * dealing with a flat model
50 * @param id id of a child memento to read from. May be <code>null</code>.
51 * @param memento memento to read from
52 */
53 void restoreViewstate(TimeBarViewer timeBarViewer, IHierarchyIdService idService, String id, IMemento memento);
54
55 }