KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > cheatsheets > state > NoSaveStateManager


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 /**
13  * The default state manager for a cheat sheet. The data will be saved and restored
14  * using a file in metadata whose name is derived from the id
15  */

16
17 package org.eclipse.ui.internal.cheatsheets.state;
18
19 import java.util.Properties JavaDoc;
20
21 import org.eclipse.core.runtime.IStatus;
22 import org.eclipse.core.runtime.Status;
23 import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
24 import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
25
26 /**
27  * A state manager which never saves or restores state. Each cheat sheet
28  * opened with this state manager will have initial state
29  */

30
31 public class NoSaveStateManager implements ICheatSheetStateManager {
32
33     private CheatSheetElement element;
34     public Properties JavaDoc getProperties() {
35         return null;
36     }
37
38     public CheatSheetManager getCheatSheetManager() {
39         CheatSheetManager result = new CheatSheetManager(element);
40         return result;
41     }
42
43     public void setElement(CheatSheetElement element) {
44         this.element = element;
45     }
46
47     public IStatus saveState(Properties JavaDoc properties, CheatSheetManager manager) {
48         return Status.OK_STATUS;
49     }
50 }
51
Popular Tags