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.core.runtime.Status;
16: import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
17: import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
18:
19: /**
20: * A state manager used to pass cheat sheet state to and from a tray dialog.
21: * It does not save any data to a file, it just acts as a conduit between
22: * two different CheatSheetViewers
23: */
24:
25: public class TrayStateManager implements ICheatSheetStateManager {
26:
27: private Properties properties;
28: private CheatSheetManager manager;
29:
30: public Properties getProperties() {
31: return properties;
32: }
33:
34: public void setElement(CheatSheetElement element) {
35: // element not used
36: }
37:
38: public CheatSheetManager getCheatSheetManager() {
39: return manager;
40: }
41:
42: /**
43: * Save the properties and cheat sheet manager locally so they can be passed
44: * to and from a cheat sheet viewer in a tray dialog.
45: */
46: public IStatus saveState(Properties properties,
47: CheatSheetManager manager) {
48: this.properties = properties;
49: this.manager = manager;
50: return Status.OK_STATUS;
51: }
52:
53: }
|