KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.eclipse.ui.internal.cheatsheets.state;
13
14 import java.util.Properties JavaDoc;
15
16 import org.eclipse.core.runtime.IStatus;
17 import org.eclipse.core.runtime.Status;
18 import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
19 import org.eclipse.ui.internal.cheatsheets.views.CheatSheetManager;
20
21 /**
22  * A state manager used to pass cheat sheet state to and from a tray dialog.
23  * It does not save any data to a file, it just acts as a conduit between
24  * two different CheatSheetViewers
25  */

26
27 public class TrayStateManager implements ICheatSheetStateManager {
28
29     private Properties JavaDoc properties;
30     private CheatSheetManager manager;
31
32     public Properties JavaDoc getProperties() {
33         return properties;
34     }
35
36     public void setElement(CheatSheetElement element) {
37         // element not used
38
}
39
40     public CheatSheetManager getCheatSheetManager() {
41         return manager;
42     }
43
44     /**
45      * Save the properties and cheat sheet manager locally so they can be passed
46      * to and from a cheat sheet viewer in a tray dialog.
47      */

48     public IStatus saveState(Properties JavaDoc properties, CheatSheetManager manager) {
49         this.properties = properties;
50         this.manager = manager;
51         return Status.OK_STATUS;
52     }
53
54 }
55
Popular Tags