01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui;
11:
12: /**
13: * An editor can implement this interface and participate in the workbench
14: * session save/restore cycle using <code>IMemento</code>, similar to how
15: * <code>IViewPart</code> currently works.
16: * <p>
17: * Refer to IWorkbenchPart for the part lifecycle.
18: * </p>
19: * <p>
20: * If a memento is available, restoreState(*) will be inserted into the editor
21: * startup.
22: * <ol>
23: * <li><code>editor.init(site, input)</code></li>
24: * <li><code>editor.restoreState(memento)</code></li>
25: * <li><code>editor.createPartControl(parent)</code></li>
26: * <li>...</li>
27: * </ol>
28: * </p>
29: * <p>
30: * On workbench shutdown, the editor state will be persisted when the editor
31: * references are saved.
32: * </p>
33: *
34: * @since 3.3
35: */
36: public interface IPersistableEditor extends IPersistable {
37: /**
38: * Called with a memento for this editor. The editor can parse the data or
39: * save the memento. This method may not be called.
40: *
41: * @param memento
42: * the saved state for this editor. May be <code>null</code>.
43: */
44: public void restoreState(IMemento memento);
45: }
|