Interface ICheatSheetManager
-
public interface ICheatSheetManager
Manages the running of a cheat sheet.Each cheat sheet that is opened in the UI is assigned its own cheat sheet manager, which stays with it until the cheat sheet is completed (or restarted). The cheat sheet manager is passed as a parameter to cheat sheet-aware actions which implement
ICheatSheetAction
. The manager carries arbitrary key-value data (strings) for the lifetime of a cheat sheet, and can be accessed viagetData(String)
andsetData(String, String)
. If the workbench is shut down while the cheat sheet is in progress, this data will generally be saved and later restored when the workbench is restarted and cheat sheet is resumed. The manager also supports aCheatSheetListener
(specified via the "listener" attribute of the "cheatsheet" element in the cheat sheet content file), which is kept informed of life cycle events over the course of the cheat sheet's life time.- Since:
- 3.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCheatSheetID()
Returns the id of the cheat sheet managed by this manager.String
getData(String key)
Returns the data value associated with the given key.Set<String>
getKeySet()
Get the keys for the data in this cheat sheet managerICheatSheetManager
getParent()
Get the cheat sheet manager for the enclosing composite cheat sheet.void
setData(String key, String data)
Sets the data value associated with the given key.
-
-
-
Method Detail
-
getCheatSheetID
String getCheatSheetID()
Returns the id of the cheat sheet managed by this manager.- Returns:
- the cheat sheet id
-
getData
String getData(String key)
Returns the data value associated with the given key.- Parameters:
key
- the key- Returns:
- the string data associated with the key, or
null
none - Throws:
IllegalArgumentException
- ifkey
isnull
-
setData
void setData(String key, String data)
Sets the data value associated with the given key.Data associated with a cheat sheet manager is remembered for the life of the manager. All data is discarded when the cheat sheet is completed (or restarted).
- Parameters:
key
- the keydata
- the string data associated with the key, ornull
to remove- Throws:
IllegalArgumentException
- ifkey
isnull
-
getParent
ICheatSheetManager getParent()
Get the cheat sheet manager for the enclosing composite cheat sheet.- Returns:
- The cheat sheet manager for the composite cheat sheet which contains
this cheat sheet as a task or
null
if this cheatsheet was not opened as a subtask of a composite cheat sheet. - Since:
- 3.2
-
-