Skip to content

Instantly share code, notes, and snippets.

@AndrienkoAleksandr
Created May 13, 2017 09:19
Show Gist options
  • Save AndrienkoAleksandr/a417fc6355a8f5a9f2dec1d29adf838c to your computer and use it in GitHub Desktop.
Save AndrienkoAleksandr/a417fc6355a8f5a9f2dec1d29adf838c to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<cheatsheet title="Sample Cheat Sheet">
<intro>
<description>A cheat sheet which demonstrates the use of perform-when and conditional subitems</description>
</intro>
<item title="View Selection">
<description>Select a view which will be opened in the following steps.</description>
<command returns = "result"
serialization="org.eclipse.ui.dialogs.openMessageDialog(title=Select View,buttonLabel0=Package Explorer,message=Select a view ,buttonLabel1=Search View)"/>
<onCompletion> Selected the ${result}. </onCompletion>
</item>
<item title="Close Views">
<description>Close the search view and package explorer if open</description>
</item>
<item title="Open the view from a perform when item" skip = "true">
<description>Uses perform when to open the view seleted previously.</description>
<perform-when condition = "${result}">
<command when = "Package Explorer"
serialization="org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.jdt.ui.PackageExplorer)"/>
<command when = "Search View"
serialization="org.eclipse.ui.views.showView(org.eclipse.ui.views.showView.viewId=org.eclipse.search.ui.views.SearchView)"/>
</perform-when>
</item>
<item title="Close Views">
<description>Close the search view and package explorer if open</description>
</item>
<item title="Open the view from a perform when subitem">
<description>Uses perform when to open the view seleted previously.</description>
<subitem label="Perform when subitem" skip = "true">
<perform-when condition = "${result}">
<command when = "Package Explorer"
serialization="org.eclipse.jdt.ui.PackageExplorer"/>
<command when = "Search View"
serialization="org.eclipse.search.ui.views.SearchView"/>
</perform-when>
</subitem>
</item>
<item title="Close Views">
<description>Close the search view and package explorer if open</description>
</item>
<item title="Open the view from a conditional subitem">
<description>Uses perform when to open the view seleted previously.</description>
<conditional-subitem condition="${result}">
<subitem when="Package Explorer" label="Open package explorer.">
<command serialization = "org.eclipse.jdt.ui.PackageExplorer"/>
</subitem>
<subitem when="Search View" label="Open Search View">
<command serialization = "org.eclipse.search.ui.views.SearchView"/>
</subitem>
</conditional-subitem>
</item>
</cheatsheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment