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.internal.cheatsheets.state;
11:
12: import java.util.Properties;
13:
14: import org.eclipse.core.runtime.IStatus;
15: import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
16: import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
17:
18: /**
19: * This interface is an abstraction of the state saving functions for a cheat sheet.
20: * Depending on how a cheat sheet is opened the state may be opened from
21: * a memento passed in, a file whose name is determined from the id of the
22: * cheat sheet, or in the case of a tray dialog it is passed using an object.
23: */
24:
25: public interface ICheatSheetStateManager {
26:
27: /**
28: * Will be called before any of the functions to get or save state
29: * @param element
30: */
31: public void setElement(CheatSheetElement element);
32:
33: /**
34: * Load the properties from the state file/memento/memory
35: */
36: public Properties getProperties();
37:
38: /**
39: * Load the cheat sheet manager from state file/memento/memory
40: */
41: public CheatSheetManager getCheatSheetManager();
42:
43: /**
44: * Save the properties and the cheat sheet manager
45: * @param properties
46: * @param manager
47: * @return
48: */
49: public IStatus saveState(Properties properties,
50: CheatSheetManager manager);
51:
52: }
|