Interface ICheatSheetViewer
Clients call CheatSheetViewerFactory.createCheatSheetView() to create
a cheat sheet viewer instance, and then call the viewer's
createPartControl method to have it create the viewer's control
under the specified SWT composite. The viewer's control can then be retrieved
using getControl to arrange layout. The setInput
methods are used to set (or clear) the cheat sheet shown in the viewer,
and can be called either before or after the viewer's controls have been
created and laid out.
The execution states of open cheat sheets are maintained and persisted globally using the cheat sheet id as the key.
- Since:
- 3.0
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePartControl(Composite parent) Creates the SWT controls for this cheat sheet viewer.Returns the id of the cheat sheet showing in this view.Returns the primary control associated with this viewer.voidSets the currently active cheat sheet to its initial state and initalizes the cheat sheet manager data.voidsetFocus()Asks this cheat sheet viewer to take focus.voidSets the cheat sheet viewer to show the cheat sheet with the given id.voidSets the cheat sheet viewer to show the cheat sheet with the given cheat sheet content file.
-
Method Details
-
createPartControl
Creates the SWT controls for this cheat sheet viewer.When the parent Composite is disposed, this will automatically dispose the controls added by this viewer (and release any other viewer-specific state).
- Parameters:
parent- the parent control
-
getControl
Control getControl()Returns the primary control associated with this viewer.- Returns:
- the SWT control which displays this viewer's
content, or
nullif this viewer's controls have not yet been created.
-
getCheatSheetID
String getCheatSheetID()Returns the id of the cheat sheet showing in this view.- Returns:
- id the cheat sheet id, or
nullif the view is not showing a cheat sheet
-
setFocus
void setFocus()Asks this cheat sheet viewer to take focus. -
setInput
Sets the cheat sheet viewer to show the cheat sheet with the given id. The cheat sheet content file is located via theorg.eclipse.ui.cheatsheets.cheatSheetContentextension point. The viewer shows an error message if there is no cheat sheet with the given id.The execution states of open cheat sheets are maintained and persisted globally using the cheat sheet id as the key.
- Parameters:
id- the cheat sheet id, ornullto show no cheat sheet in this viewer
-
setInput
Sets the cheat sheet viewer to show the cheat sheet with the given cheat sheet content file. The viewer shows an error message if the cheat sheet content file cannot be opened or parsed.The execution states of open cheat sheets are maintained and persisted globally using the cheat sheet id as the key. This means that each cheat sheet must have a distinct id, including ones opened from URLs.
Use the other
setInputmethod to clear the viewer; that is, callsetInput(null).- Parameters:
id- the id to give this cheat sheetname- the name to give this cheat sheeturl- URL of the cheat sheet content file- Throws:
IllegalArgumentException- if the parameters arenull
-
reset
Sets the currently active cheat sheet to its initial state and initalizes the cheat sheet manager data.- Parameters:
cheatSheetData- A map whose keys and values are all of typejava.lang.Stringornullto reset all data in the cheat sheet manager.- Since:
- 3.2
-