KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > cheatsheets > ICheatSheetManager


1 /*******************************************************************************
2  * Copyright (c) 2004, 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 package org.eclipse.ui.cheatsheets;
12
13 import java.util.Set JavaDoc;
14
15 /**
16  * Manages the running of a cheat sheet.
17  * <p>
18  * Each cheat sheet that is opened in the UI is assigned its own cheat sheet
19  * manager, which stays with it until the cheat sheet is completed (or
20  * restarted). The cheat sheet manager is passed as a parameter to cheat
21  * sheet-aware actions which implement {@link ICheatSheetAction}. The manager
22  * carries arbitrary key-value data (strings) for the lifetime of a cheat sheet,
23  * and can be accessed via {@link #getData(String)}and
24  * {@link #setData(String, String)}. If the workbench is shut down while the
25  * cheat sheet is in progress, this data will generally be saved and later
26  * restored when the workbench is restarted and cheat sheet is resumed. The
27  * manager also supports a {@link CheatSheetListener}(specified via the
28  * "listener" attribute of the "cheatsheet" element in the cheat sheet content
29  * file), which is kept informed of life cycle events over the course of the
30  * cheat sheet's life time.
31  * </p>
32  * <p>
33  * This interface is not intended to be implemented by clients.
34  * </p>
35  *
36  * @since 3.0
37  */

38 public interface ICheatSheetManager {
39
40     /**
41      * Returns the id of the cheat sheet managed by this manager.
42      *
43      * @return the cheat sheet id
44      */

45     public String JavaDoc getCheatSheetID();
46
47     /**
48      * Returns the data value associated with the given key.
49      *
50      * @param key the key
51      * @return the string data associated with the key, or
52      * <code>null</code> none
53      * @exception IllegalArgumentException if <code>key</code>
54      * is <code>null</code>
55      */

56     public String JavaDoc getData(String JavaDoc key);
57
58     /**
59      * Sets the data value associated with the given key.
60      * <p>
61      * Data associated with a cheat sheet manager is remembered
62      * for the life of the manager. All data is discarded when
63      * the cheat sheet is completed (or restarted).
64      * </p>
65      *
66      * @param key the key
67      * @param data the string data associated with the key,
68      * or <code>null</code> to remove
69      * @exception IllegalArgumentException if <code>key</code>
70      * is <code>null</code>
71      */

72     public void setData(String JavaDoc key, String JavaDoc data);
73     
74     /**
75      * Get the cheat sheet manager for the enclosing composite cheat sheet.
76      * @return The cheat sheet manager for the composite cheat sheet which contains
77      * this cheat sheet as a task or <code>null</code> if this cheatsheet was not
78      * opened as a subtask of a composite cheat sheet.
79      * @since 3.2
80      */

81     public ICheatSheetManager getParent();
82     
83     /**
84      * Get the keys for the data in this cheat sheet manager
85      * @return The set of keys.
86      * @since 3.2
87      */

88     public Set JavaDoc getKeySet();
89 }
90
Popular Tags