try the search console sample project
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/.classpath b/plugins/org.eclipse.wst.sse.sieditor.search/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/.project b/plugins/org.eclipse.wst.sse.sieditor.search/.project
new file mode 100644
index 0000000..2456f51
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.wst.sse.sieditor.search</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.sse.sieditor.search/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..326199b
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed Jan 26 10:28:52 EET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.sse.sieditor.search/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5c11d5e
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Search
+Bundle-SymbolicName: org.eclipse.wst.sse.sieditor.search;singleton:=true
+Bundle-Version: 0.11.0.qualifier
+Bundle-Activator: org.eclipse.wst.sse.sieditor.search.internal.plugin.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.cheatsheets;bundle-version="3.4.0",
+ org.eclipse.platform.discovery.core;bundle-version="0.11.0",
+ org.eclipse.platform.discovery.integration;bundle-version="0.11.0",
+ org.eclipse.platform.discovery.runtime;bundle-version="0.11.0",
+ org.eclipse.platform.discovery.ui;bundle-version="0.11.0",
+ org.eclipse.platform.discovery.util;bundle-version="0.11.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.wst.sse.sieditor.search.destinations,
+ org.eclipse.wst.sse.sieditor.search.internal.persistency,
+ org.eclipse.wst.sse.sieditor.search.internal.plugin,
+ org.eclipse.wst.sse.sieditor.search.internal.runtime,
+ org.eclipse.wst.sse.sieditor.search.internal.search,
+ org.eclipse.wst.sse.sieditor.search.internal.slave,
+ org.eclipse.wst.sse.sieditor.search.internal.text,
+ org.eclipse.wst.sse.sieditor.search.internal.view,
+ org.eclipse.wst.sse.sieditor.search.internal.view.console,
+ org.eclipse.wst.sse.sieditor.search.internal.view.favorites
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.class
new file mode 100644
index 0000000..54cc9f9
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.class
new file mode 100644
index 0000000..a1d35df
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.class
new file mode 100644
index 0000000..127da1b
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.class
new file mode 100644
index 0000000..d5d5cca
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.class
new file mode 100644
index 0000000..9210a0a
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.class
new file mode 100644
index 0000000..062f201
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.class
new file mode 100644
index 0000000..1b6b5ac
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.class
new file mode 100644
index 0000000..a29a51c
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.class
new file mode 100644
index 0000000..1937412
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.class
new file mode 100644
index 0000000..a1f9de2
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.class
new file mode 100644
index 0000000..f920645
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.class
new file mode 100644
index 0000000..7e43f11
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.class
new file mode 100644
index 0000000..e1a1b55
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.class
new file mode 100644
index 0000000..dcd0cd5
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$CheatSheetMatcher.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$CheatSheetMatcher.class
new file mode 100644
index 0000000..8e941a0
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$CheatSheetMatcher.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$QueryOperation.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$QueryOperation.class
new file mode 100644
index 0000000..750b8df
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery$QueryOperation.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.class
new file mode 100644
index 0000000..eaf8ed6
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.class
new file mode 100644
index 0000000..4f8bf2b
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.class
new file mode 100644
index 0000000..d4a2331
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.class
new file mode 100644
index 0000000..c8ad6eb
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.class
new file mode 100644
index 0000000..6f3d91f
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.class
new file mode 100644
index 0000000..5ef6051
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.class
new file mode 100644
index 0000000..2072de1
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.class
new file mode 100644
index 0000000..8ff7026
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties
new file mode 100644
index 0000000..5ffb154
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2010 SAP AG, Walldorf.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Georgi Konstantinov - initial API and implementation.
+###############################################################################
+AllCategoriesCDDestination_DisplayName=All Categories
+FavoritesCustomization_CheatSheetGroupName=Cheat Sheets
+CheatSheetSearchProvider_ByCategoryGrouping=By Categories
+CheatSheetSearchProvider_FlatListGrouping=Flat List
+DeleteFromFavorites=Delete
+RunCheatSheetAction_Label=Open
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.class
new file mode 100644
index 0000000..2856087
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$1.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$1.class
new file mode 100644
index 0000000..8f11eae
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$1.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$2.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$2.class
new file mode 100644
index 0000000..2969a3a
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization$2.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.class
new file mode 100644
index 0000000..0150cf7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.class
new file mode 100644
index 0000000..8492bc8
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.class
new file mode 100644
index 0000000..bee4d66
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.class
new file mode 100644
index 0000000..5563ca7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.class
new file mode 100644
index 0000000..84fafd7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$1.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$1.class
new file mode 100644
index 0000000..730b3fd
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$1.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$2.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$2.class
new file mode 100644
index 0000000..2298545
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization$2.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.class b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.class
new file mode 100644
index 0000000..f59bfac
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/bin/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.class
Binary files differ
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/build.properties b/plugins/org.eclipse.wst.sse.sieditor.search/build.properties
new file mode 100644
index 0000000..0dc34f7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/plugin.properties b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.properties
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.properties
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml
new file mode 100644
index 0000000..87a5c11
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.platform.discovery.runtime.objecttype">
+ <objecttype
+ displayname="Cheat Sheets"
+ id="org.eclipse.demo.cheatsheets.search.objecttype.cheatSheet">
+ </objecttype>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.runtime.destinationcategory">
+ <destinationcategory
+ destinationclass="org.eclipse.wst.sse.sieditor.search.destinations.CSDestination"
+ displayname="Local Cheetsheets"
+ id="org.eclipse.demo.cheatsheets.search.destinationcategory.local">
+ </destinationcategory>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.runtime.destinationsprovider">
+ <destinationsprovider
+ destcategoryid="org.eclipse.demo.cheatsheets.search.destinationcategory.local"
+ id="org.eclipse.demo.cheatsheets.search.destinationsprovider.local"
+ provider="org.eclipse.wst.sse.sieditor.search.destinations.LocalCSDestinationsProvider">
+ </destinationsprovider>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.runtime.searchprovider">
+ <searchprovider
+ id="org.eclipse.demo.cheatsheets.search.internal.search.LocalCheatSheetSearchProvider"
+ instance="org.eclipse.wst.sse.sieditor.search.internal.search.LocalCheatSheetSearchProvider"
+ objecttypeid="org.eclipse.demo.cheatsheets.search.objecttype.cheatSheet"
+ supportstextsearch="true">
+ <category
+ categoryid="org.eclipse.demo.cheatsheets.search.destinationcategory.local">
+ </category>
+ </searchprovider>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.integration.searchconsole">
+ <viewcustomization
+ customizationimpl="org.eclipse.wst.sse.sieditor.search.internal.view.console.ConsoleCustomization"
+ id="org.eclipse.demo.cheatsheets.search.internal.view.ConsoleCustomization">
+ </viewcustomization>
+ <slavecontroller
+ id="org.eclipse.demo.cheatsheets.search.internal.slave.ConsoleSlaveController"
+ implclass="org.eclipse.wst.sse.sieditor.search.internal.slave.ConsoleSlaveController">
+ </slavecontroller>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.integration.searchfavorites">
+ <viewcustomization
+ customizationimpl="org.eclipse.wst.sse.sieditor.search.internal.view.favorites.FavoritesCustomization"
+ id="org.eclipse.demo.cheatsheets.search.internal.view.favorites.FavoritesCustomization">
+ </viewcustomization>
+ <slavecontroller
+ id="org.eclipse.demo.cheatsheets.search.internal.slave.FavoritesSlaveController"
+ implclass="org.eclipse.wst.sse.sieditor.search.internal.slave.FavoritesSlaveController">
+ </slavecontroller>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.integration.persistence.mementostoreprovider">
+ <provider
+ class="org.eclipse.wst.sse.sieditor.search.internal.persistency.CSStoreProvider"
+ id="org.eclipse.demo.cheatsheets.search.internal.persistency.CSStoreProvider">
+ </provider>
+ </extension>
+ <extension
+ point="org.eclipse.platform.discovery.integration.persistence.mementoloadprovider">
+ <provider
+ class="org.eclipse.wst.sse.sieditor.search.internal.persistency.CSLoadProvider"
+ id="org.eclipse.demo.cheatsheets.search.internal.persistency.CSLoadProvider">
+ </provider>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.java
new file mode 100644
index 0000000..d20bf4d
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/AllCategoriesDest.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.destinations;
+
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.text.Messages;
+
+/**
+ * Destination for all cheat sheets categories
+ *
+ * @author danail
+ */
+public class AllCategoriesDest extends CSDestination {
+ public AllCategoriesDest(ICheatSheetCategory csCat) {
+ super(csCat);
+ }
+
+ @Override
+ public String getDisplayName() {
+ return Messages.AllCategoriesCDDestination_DisplayName;
+ }
+
+ @Override
+ public String getDestinationID() {
+ return AllCategoriesDest.class.getName();
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.java
new file mode 100644
index 0000000..9455984
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/CSDestination.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.destinations;
+
+import org.eclipse.platform.discovery.runtime.api.ISearchDestination;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+
+/**
+ * Cheat sheets search destination
+ *
+ * @author danail
+ */
+public class CSDestination implements ISearchDestination {
+ private final ICheatSheetCategory csCat;
+
+ public CSDestination(final ICheatSheetCategory csCat) {
+ this.csCat = csCat;
+ }
+
+ public ICheatSheetCategory getCategory() {
+ return csCat;
+ }
+
+ @Override
+ public String getDisplayName() {
+ return csCat.getName();
+ }
+
+ public String getDestinationID() {
+ return csCat.getID();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (!obj.getClass().equals(this.getClass())) {
+ return false;
+ }
+
+ final CSDestination destination = (CSDestination) obj;
+ if (this.csCat == null) {
+ return destination.csCat == null;
+ }
+
+ return this.csCat.getID().equals(destination.csCat.getID());
+ }
+
+ @Override
+ public int hashCode() {
+ if (this.csCat == null) {
+ return -1;
+ }
+
+ return this.csCat.getID().hashCode();
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.java
new file mode 100644
index 0000000..6811bcb
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/destinations/LocalCSDestinationsProvider.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.destinations;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.platform.discovery.runtime.api.IDestinationChangeHandler;
+import org.eclipse.platform.discovery.runtime.api.IDestinationsProvider;
+import org.eclipse.platform.discovery.runtime.api.ISearchDestination;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.CSLoader;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetItem;
+
+public class LocalCSDestinationsProvider implements IDestinationsProvider {
+ @Override
+ public Set<ISearchDestination> getSearchDestinations() {
+ final Set<ISearchDestination> result = new HashSet<ISearchDestination>();
+ final ICheatSheetCategory rootCategory = new CSLoader().loadCheatSheets();
+ result.add(new AllCategoriesDest(rootCategory));
+
+ for (ICheatSheetItem item : rootCategory.getChildren()) {
+ if (item instanceof ICheatSheetCategory) {
+ result.add(new CSDestination((ICheatSheetCategory) item));
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public void registerDestinationsChangeHandler(IDestinationChangeHandler handler) {
+ }
+
+ @Override
+ public void unregisterDestinationsChangeHandler(IDestinationChangeHandler handler) {
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.java
new file mode 100644
index 0000000..f54539f
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSLoadProvider.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.persistency;
+
+import java.text.MessageFormat;
+
+import org.eclipse.platform.discovery.runtime.api.ISearchDestination;
+import org.eclipse.platform.discovery.runtime.api.persistence.DestinationItemPair;
+import org.eclipse.platform.discovery.runtime.api.persistence.IMementoLoadProvider;
+import org.eclipse.platform.discovery.runtime.api.persistence.MementoLoadProviderException;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperationRunner;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader;
+import org.eclipse.wst.sse.sieditor.search.destinations.CSDestination;
+import org.eclipse.wst.sse.sieditor.search.destinations.LocalCSDestinationsProvider;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.CheatSheetImpl;
+
+/**
+ * Load provider for cheat sheets. Used for loading favorite cheat sheets items
+ * in the search favorites view
+ *
+ * @author danail
+ */
+@SuppressWarnings("restriction")
+public class CSLoadProvider implements IMementoLoadProvider, CSPersistency {
+ @Override
+ public String getDescriptor() {
+ return "Cheat Sheet Load Provider"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getChildType() {
+ return CHEAT_SHEET_PERS_TYPE;
+ }
+
+ @Override
+ public boolean canLoad(IMemento container) {
+ return container != null && CHEAT_SHEET_PERS_TYPE.equals(container.getType())
+ && CHEAT_SHEET_PERS_TAG_ID.equals(container.getID());
+ }
+
+ @Override
+ public DestinationItemPair load(IMemento container, ILongOperationRunner opRunner) throws MementoLoadProviderException {
+ final String csID = container.getString(CHEAT_SHEET_ID_ATTRIBUTE);
+ final String destinationId = container.getString(CHEAT_SHEET_DESTINATION_ATTRIBUTE);
+ final CheatSheetElement sheet = CheatSheetRegistryReader.getInstance().findCheatSheet(csID);
+ if (sheet == null) {
+ throw new MementoLoadProviderException(MessageFormat.format("Cheat sheet with id={0} not found", csID)); //$NON-NLS-1$
+ }
+
+ for (ISearchDestination dest : new LocalCSDestinationsProvider().getSearchDestinations()) {
+ if (((CSDestination) dest).getDestinationID().equals(destinationId)) {
+ return new DestinationItemPair(dest, new CheatSheetImpl(sheet, null));
+ }
+ }
+
+ throw new MementoLoadProviderException(MessageFormat.format("Destination with id={0} not found", destinationId)); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.java
new file mode 100644
index 0000000..407815b
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSPersistency.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.persistency;
+
+@SuppressWarnings("nls")
+interface CSPersistency {
+ static final String CHEAT_SHEET_PERS_TAG_ID = "cheat-sheet";
+ static final String CHEAT_SHEET_PERS_TYPE = "cheat-sheet-type";
+ static final String CHEAT_SHEET_ID_ATTRIBUTE = "cheat-sheet-id";
+ static final String CHEAT_SHEET_DESTINATION_ATTRIBUTE = "cheat-sheet-destination";
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.java
new file mode 100644
index 0000000..7d34f96
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/persistency/CSStoreProvider.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.persistency;
+
+import org.eclipse.platform.discovery.runtime.api.persistence.DestinationItemPair;
+import org.eclipse.platform.discovery.runtime.api.persistence.IMementoStoreProvider;
+import org.eclipse.platform.discovery.runtime.api.persistence.MementoStoreProviderException;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperationRunner;
+import org.eclipse.ui.IMemento;
+import org.eclipse.wst.sse.sieditor.search.destinations.CSDestination;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+
+/**
+ * Store provider for favorites cheat sheets. Used for persisting favorite cheat
+ * sheets in the search favorites view
+ *
+ * @author danail
+ */
+public class CSStoreProvider implements IMementoStoreProvider, CSPersistency {
+ @Override
+ public String getDescriptor() {
+ return "Cheat Sheets Store Provider"; //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean canStore(DestinationItemPair resource) {
+ return resource.getItem() instanceof ICheatSheet;
+ }
+
+ @Override
+ public void store(IMemento container, DestinationItemPair resource, ILongOperationRunner opRunner)
+ throws MementoStoreProviderException {
+ final IMemento memento = container.createChild(CHEAT_SHEET_PERS_TYPE, CHEAT_SHEET_PERS_TAG_ID);
+ memento.putString(CHEAT_SHEET_ID_ATTRIBUTE, ((ICheatSheet) resource.getItem()).getID());
+ memento.putString(CHEAT_SHEET_DESTINATION_ATTRIBUTE, ((CSDestination) resource.getDestination()).getDestinationID());
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.java
new file mode 100644
index 0000000..bb247f4
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/plugin/Activator.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.plugin;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.demo.cheatsheets.search"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.java
new file mode 100644
index 0000000..0043c26
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CSLoader.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetCollectionElement;
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader;
+
+/**
+ * Utility for loading favorite cheat sheets
+ *
+ * @author danail
+ */
+@SuppressWarnings("restriction")
+public class CSLoader {
+ public ICheatSheetCategory loadCheatSheets() {
+ final ICheatSheetCategory loadedItems = new RootCSItem();
+ CheatSheetRegistryReader regReader = CheatSheetRegistryReader.getInstance();
+ final CheatSheetCollectionElement csCollection = regReader.getCheatSheets();
+ fillCategory(loadedItems, csCollection);
+ return loadedItems;
+ }
+
+ private void fillCategory(final ICheatSheetCategory csCategory, CheatSheetCollectionElement csCollection) {
+ final Collection<CheatSheetElement> cheatSheets = new ArrayList<CheatSheetElement>();
+ for (Object o : csCollection.getCheatSheets()) {
+ cheatSheets.add((CheatSheetElement) o);
+ }
+
+ final Collection<CheatSheetCollectionElement> subCategories = new ArrayList<CheatSheetCollectionElement>();
+ for (Object o : csCollection.getChildren()) {
+ subCategories.add((CheatSheetCollectionElement) o);
+ }
+
+ for (CheatSheetCollectionElement elem : subCategories) {
+ final ICheatSheetCategory cat = new CheatSheetCategoryImpl(elem, csCategory);
+ csCategory.getChildren().add(cat);
+ fillCategory(cat, elem);
+ }
+
+ for (CheatSheetElement elem : cheatSheets) {
+ csCategory.getChildren().add(new CheatSheetImpl(elem, csCategory));
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.java
new file mode 100644
index 0000000..4241514
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetCategoryImpl.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetCollectionElement;
+
+@SuppressWarnings("restriction")
+public class CheatSheetCategoryImpl implements ICheatSheetCategory {
+ private static final String NULL = "null"; //$NON-NLS-1$
+ private final ICheatSheetCategory parent;
+ private Collection<ICheatSheetItem> children;
+ private CheatSheetCollectionElement csCategory;
+
+ public CheatSheetCategoryImpl(final CheatSheetCollectionElement csCategory, final ICheatSheetCategory parent) {
+ this.csCategory = csCategory;
+ this.parent = parent;
+ this.children = new ArrayList<ICheatSheetItem>();
+ }
+
+ @Override
+ public String getID() {
+ return csCategory == null ? NULL : csCategory.getId();
+ }
+
+ @Override
+ public String getName() {
+ return csCategory == null ? NULL : csCategory.getLabel(null);
+ }
+
+ @Override
+ public ICheatSheetCategory getParent() {
+ return this.parent;
+ }
+
+ @Override
+ public Collection<ICheatSheetItem> getChildren() {
+ return this.children;
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ return "Category " + getName() + "; id=" + getID();
+ }
+
+ @Override
+ public CheatSheetCollectionElement getCollectionElement() {
+ return this.csCategory;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.java
new file mode 100644
index 0000000..79bb880
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/CheatSheetImpl.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement;
+
+@SuppressWarnings("restriction")
+public class CheatSheetImpl implements ICheatSheet {
+ private CheatSheetElement csElement;
+ private ICheatSheetCategory parent;
+
+ public CheatSheetImpl(final CheatSheetElement csElement, final ICheatSheetCategory parent) {
+ this.csElement = csElement;
+ this.parent = parent;
+ }
+
+ @Override
+ public String getID() {
+ return this.csElement.getID();
+ }
+
+ @Override
+ public String getName() {
+ return this.csElement.getLabel(null);
+ }
+
+ @Override
+ public ICheatSheetCategory getParent() {
+ return this.parent;
+ }
+
+ @SuppressWarnings("nls")
+ @Override
+ public String toString() {
+ return "Cheetsheet " + getName() + "; id=" + getID();
+ }
+
+ @Override
+ public String getDescription() {
+ return csElement.getDescription();
+ }
+
+ @Override
+ public boolean isComposite() {
+ return csElement.isComposite();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+
+ if (!obj.getClass().equals(this.getClass())) {
+ return false;
+ }
+
+ final CheatSheetImpl cs = (CheatSheetImpl) obj;
+ return this.csElement.equals(cs.csElement);
+ }
+
+ @Override
+ public int hashCode() {
+ return this.csElement.hashCode();
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.java
new file mode 100644
index 0000000..a0350e1
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheet.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+/**
+ * Interface for the cheat sheet item itself
+ *
+ * @author danail
+ */
+public interface ICheatSheet extends ICheatSheetItem {
+ public String getDescription();
+
+ /**
+ * Whether the cheat sheet is composite
+ *
+ * @see org.eclipse.ui.internal.cheatsheets.registry.CheatSheetElement#isComposite()
+ */
+ @SuppressWarnings("restriction")
+ public boolean isComposite();
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.java
new file mode 100644
index 0000000..09bce0e
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetCategory.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+import java.util.Collection;
+
+import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetCollectionElement;
+
+/**
+ * Interface for cheat sheets categories
+ *
+ * @author danail
+ */
+@SuppressWarnings("restriction")
+public interface ICheatSheetCategory extends ICheatSheetItem {
+ /**
+ * Retrieve a possibly empty collection of children of this category
+ */
+ public Collection<ICheatSheetItem> getChildren();
+
+ /**
+ * Retrieves the {@link CheatSheetCollectionElement} instance representing
+ * the category
+ *
+ * @return
+ */
+ public CheatSheetCollectionElement getCollectionElement();
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.java
new file mode 100644
index 0000000..0cf801c
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/ICheatSheetItem.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+/**
+ * Abstract interface for a cheat sheet items. The item can be either the cheat
+ * sheet itself, or the category it belongs to, or the parent category of an
+ * category
+ *
+ * @author danail
+ *
+ */
+public interface ICheatSheetItem {
+ /**
+ * The cheat sheet ID
+ */
+ public String getID();
+
+ /**
+ * The item name
+ */
+ public String getName();
+
+ /**
+ * The parent
+ *
+ * @return the parent or null
+ */
+ public ICheatSheetCategory getParent();
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.java
new file mode 100644
index 0000000..5ee9212
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/runtime/RootCSItem.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.runtime;
+
+/**
+ * Artificial cheat sheet item. Used as a parent for all cheat sheet items out
+ * there
+ *
+ * @author danail
+ */
+public class RootCSItem extends CheatSheetCategoryImpl implements ICheatSheetCategory {
+ public RootCSItem() {
+ super(null, null);
+ }
+
+ @Override
+ public String toString() {
+ return "ROOT Category item"; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.java
new file mode 100644
index 0000000..bfa93d8
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/CheatSheetSearchQuery.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.search;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.platform.discovery.runtime.api.ISearchParameters;
+import org.eclipse.platform.discovery.runtime.api.SearchCancelledException;
+import org.eclipse.platform.discovery.runtime.api.SearchFailedException;
+import org.eclipse.platform.discovery.runtime.api.impl.SearchQuery;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperation;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperationRunner;
+import org.eclipse.platform.discovery.util.api.longop.LongOpCanceledException;
+import org.eclipse.wst.sse.sieditor.search.destinations.AllCategoriesDest;
+import org.eclipse.wst.sse.sieditor.search.destinations.CSDestination;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.CSLoader;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.CheatSheetCategoryImpl;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetItem;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.RootCSItem;
+
+/**
+ * The cheat sheet search query. Instantiated by the search provider
+ *
+ * @author danail
+ */
+class CheatSheetSearchQuery extends SearchQuery {
+ private ISearchParameters searchParams;
+
+ CheatSheetSearchQuery(final ISearchParameters searchParams) {
+ this.searchParams = searchParams;
+ }
+
+ @Override
+ public Object execute(final ILongOperationRunner lor) throws SearchFailedException, SearchCancelledException {
+ try {
+ return lor.run(queryOperation());
+ } catch (LongOpCanceledException e) {
+ throw new IllegalStateException("Operation does not support cancellation"); //$NON-NLS-1$
+ } catch (InvocationTargetException e) {
+ throw new SearchFailedException(e.getCause());
+ }
+ }
+
+ private ILongOperation<ICheatSheetCategory> queryOperation() {
+ final CheatSheetMatcher matcher = new CheatSheetMatcher(searchParams.getKeywordString());
+ return new QueryOperation(matcher);
+ }
+
+ private class QueryOperation implements ILongOperation<ICheatSheetCategory> {
+ private final CheatSheetMatcher mathcer;
+
+ public QueryOperation(CheatSheetMatcher matcher) {
+ this.mathcer = matcher;
+ }
+
+ @Override
+ public ICheatSheetCategory run(IProgressMonitor monitor) throws LongOpCanceledException, Exception {
+ // Check whether the user chose flat-list results grouping
+ if (searchParams.getGroupingHierarchy().equals(LocalCheatSheetSearchProvider.FLAT_LIST)) {
+ return flatListSheets();
+ } else {
+ return byCategoriesSheets();
+ }
+ }
+
+ private ICheatSheetCategory byCategoriesSheets() {
+ final ICheatSheetCategory result = new RootCSItem();
+ for (ICheatSheetCategory cat : relevantCategories()) {
+ final Collection<ICheatSheetItem> children = getCategoryChildren(cat);
+ if (children.size() > 0) {
+ final ICheatSheetCategory newCat = new CheatSheetCategoryImpl(cat.getCollectionElement(), null);
+ newCat.getChildren().addAll(children);
+ result.getChildren().add(newCat);
+ }
+ }
+
+ return result;
+ }
+
+ private Collection<ICheatSheetItem> getCategoryChildren(final ICheatSheetCategory category) {
+ final Collection<ICheatSheetItem> result = new ArrayList<ICheatSheetItem>();
+ for (ICheatSheetItem item : category.getChildren()) {
+ if (item instanceof ICheatSheetCategory) {
+ final ICheatSheetCategory childCat = new CheatSheetCategoryImpl(
+ ((ICheatSheetCategory) item).getCollectionElement(), category);
+ if (getCategoryChildren(childCat).size() > 0) {
+ result.add(childCat);
+ }
+ }
+ if (item instanceof ICheatSheet && mathcer.matches((ICheatSheet) item)) {
+ result.add((ICheatSheet) item);
+ }
+ }
+ return result;
+ }
+
+ private ICheatSheetCategory flatListSheets() {
+ final ICheatSheetCategory result = new RootCSItem();
+ for (ICheatSheetCategory cat : relevantCategories()) {
+ result.getChildren().addAll(extractCheatSheets(cat));
+ }
+ return result;
+ }
+
+ private Collection<ICheatSheet> extractCheatSheets(ICheatSheetCategory category) {
+ final Collection<ICheatSheet> result = new ArrayList<ICheatSheet>();
+ for (ICheatSheetItem item : category.getChildren()) {
+ if (item instanceof ICheatSheetCategory) {
+ result.addAll(extractCheatSheets((ICheatSheetCategory) item));
+ }
+ if (item instanceof ICheatSheet && mathcer.matches((ICheatSheet) item)) {
+ result.add((ICheatSheet) item);
+ }
+ }
+ return result;
+ }
+
+ private Collection<ICheatSheetCategory> relevantCategories() {
+ final CSDestination destination = (CSDestination) searchParams.getSearchDestination();
+ final Collection<ICheatSheetCategory> result = new ArrayList<ICheatSheetCategory>();
+ for (ICheatSheetItem item : new CSLoader().loadCheatSheets().getChildren()) {
+ assert item instanceof ICheatSheetCategory;
+ final ICheatSheetCategory cat = (ICheatSheetCategory) item;
+ if (destination.getClass().equals(AllCategoriesDest.class)
+ || destination.getCategory().getID().equals(cat.getID())) {
+ result.add(cat);
+ }
+ }
+
+ return result;
+ }
+ }
+
+ /**
+ * Very dummy matcher implementation. Would return <code>true</code> if the
+ * expression is empty or is contained in the analyzed string
+ *
+ * @author danail
+ */
+ private class CheatSheetMatcher {
+ private final String expression;
+
+ public CheatSheetMatcher(final String expression) {
+ this.expression = expression;
+ }
+
+ public boolean matches(final ICheatSheet sheet) {
+ if (expression.equals("")) //$NON-NLS-1$
+ {
+ return true;
+ }
+
+ return sheet.getName().toLowerCase().contains(expression);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.java
new file mode 100644
index 0000000..64b7202
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/search/LocalCheatSheetSearchProvider.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.search;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.platform.discovery.runtime.api.GroupingHierarchy;
+import org.eclipse.platform.discovery.runtime.api.ISearchDestination;
+import org.eclipse.platform.discovery.runtime.api.ISearchParameters;
+import org.eclipse.platform.discovery.runtime.api.ISearchQuery;
+import org.eclipse.platform.discovery.runtime.api.ISearchSubdestination;
+import org.eclipse.platform.discovery.runtime.api.impl.SearchProvider;
+import org.eclipse.wst.sse.sieditor.search.internal.text.Messages;
+
+/**
+ * The cheat sheets search provider
+ *
+ * @author danail
+ */
+public class LocalCheatSheetSearchProvider extends SearchProvider {
+ static final GroupingHierarchy FLAT_LIST;
+ static final GroupingHierarchy BY_CATEGORIES;
+ private static final Set<GroupingHierarchy> HIERARCHIES;
+
+ static {
+ FLAT_LIST = new GroupingHierarchy(Messages.CheatSheetSearchProvider_FlatListGrouping, "flat-list"); //$NON-NLS-1$
+ BY_CATEGORIES = new GroupingHierarchy(Messages.CheatSheetSearchProvider_ByCategoryGrouping, "by-categories"); //$NON-NLS-1$
+ HIERARCHIES = new HashSet<GroupingHierarchy>(Arrays.asList(new GroupingHierarchy[] { FLAT_LIST, BY_CATEGORIES }));
+ }
+
+ @Override
+ public ISearchQuery createQuery(final ISearchParameters searchParameters) {
+ return new CheatSheetSearchQuery(searchParameters);
+ }
+
+ @Override
+ public Set<GroupingHierarchy> getGroupingHierarchies(ISearchDestination soco, Set<ISearchSubdestination> subdestinations) {
+ return HIERARCHIES;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.java
new file mode 100644
index 0000000..4468174
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/CSSlaveController.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.slave;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.core.api.ISlaveController;
+
+/**
+ * Basic implementation of slave controller for cheat sheets feature.
+ * Contributes an action for running a cheat sheet
+ *
+ * @author danail
+ *
+ */
+public class CSSlaveController implements ISlaveController {
+ @Override
+ public Set<IContributedAction> createActions() {
+ final Set<IContributedAction> result = new HashSet<IContributedAction>();
+ result.add(new RunCheatSheetAction());
+ return result;
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.java
new file mode 100644
index 0000000..25c5ee7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/ConsoleSlaveController.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.slave;
+
+import org.eclipse.platform.discovery.core.api.ISearchConsoleMasterController;
+import org.eclipse.platform.discovery.core.api.ISearchConsoleSlaveController;
+
+/**
+ * The slave controller for the search console customization
+ *
+ * @author danail
+ */
+public class ConsoleSlaveController extends CSSlaveController implements ISearchConsoleSlaveController {
+ @Override
+ public void setMasterController(ISearchConsoleMasterController masterController) {
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.java
new file mode 100644
index 0000000..edb2165
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/DeleteFromFavoritesAction.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.slave;
+
+import java.util.Set;
+
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.core.api.ISearchFavoritesMasterController;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperationRunner;
+
+/**
+ * Action for deleting a cheat sheet from the search favorites view
+ *
+ * @author danail
+ *
+ */
+public class DeleteFromFavoritesAction implements IContributedAction {
+ public static final String ACTION_ID = DeleteFromFavoritesAction.class.getName();
+
+ private final ISearchFavoritesMasterController controller;
+
+ public DeleteFromFavoritesAction(final ISearchFavoritesMasterController controller) {
+ this.controller = controller;
+ }
+
+ @Override
+ public void perform(ILongOperationRunner operationRunner, Set<Object> selectedObjects) {
+ controller.deleteItems(selectedObjects);
+ }
+
+ @Override
+ public Object getActionId() {
+ return ACTION_ID;
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.java
new file mode 100644
index 0000000..deddd11
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/FavoritesSlaveController.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.slave;
+
+import java.util.Set;
+
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.core.api.ISearchFavoritesMasterController;
+import org.eclipse.platform.discovery.core.api.ISearchFavoritesSlaveController;
+
+/**
+ * The slave controller for the search favorites customization.
+ *
+ * @author danail
+ *
+ */
+public class FavoritesSlaveController extends CSSlaveController implements ISearchFavoritesSlaveController {
+ private ISearchFavoritesMasterController controller;
+
+ @Override
+ public void setMasterController(ISearchFavoritesMasterController masterController) {
+ this.controller = masterController;
+ }
+
+ @Override
+ public Set<IContributedAction> createActions() {
+ final Set<IContributedAction> actions = super.createActions();
+ actions.add(new DeleteFromFavoritesAction(controller));
+
+ return actions;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.java
new file mode 100644
index 0000000..809edb1
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/slave/RunCheatSheetAction.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.slave;
+
+import java.util.Set;
+
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.util.api.longop.ILongOperationRunner;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+
+/**
+ * The action for running cheat sheets
+ *
+ * @author danail
+ */
+public class RunCheatSheetAction implements IContributedAction {
+ public static final String ACTION_ID = RunCheatSheetAction.class.getName();
+
+ @Override
+ public void perform(ILongOperationRunner operationRunner, Set<Object> selectedObjects) {
+ final ICheatSheet cs = (ICheatSheet) selectedObjects.iterator().next();
+ new org.eclipse.ui.cheatsheets.OpenCheatSheetAction(cs.getID()).run();
+ }
+
+ @Override
+ public Object getActionId() {
+ return ACTION_ID;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.java
new file mode 100644
index 0000000..9bcd927
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/Messages.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.text;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.demo.cheatsheets.search.internal.text.messages"; //$NON-NLS-1$
+ public static String AllCategoriesCDDestination_DisplayName;
+ public static String FavoritesCustomization_CheatSheetGroupName;
+ public static String CheatSheetSearchProvider_ByCategoryGrouping;
+ public static String CheatSheetSearchProvider_FlatListGrouping;
+ public static String DeleteFromFavorites;
+ public static String RunCheatSheetAction_Label;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties
new file mode 100644
index 0000000..5ffb154
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/text/messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2010 SAP AG, Walldorf.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Georgi Konstantinov - initial API and implementation.
+###############################################################################
+AllCategoriesCDDestination_DisplayName=All Categories
+FavoritesCustomization_CheatSheetGroupName=Cheat Sheets
+CheatSheetSearchProvider_ByCategoryGrouping=By Categories
+CheatSheetSearchProvider_FlatListGrouping=Flat List
+DeleteFromFavorites=Delete
+RunCheatSheetAction_Label=Open
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.java
new file mode 100644
index 0000000..714c964
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetContentProvider.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.platform.discovery.core.api.ISearchContext;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetItem;
+
+/**
+ * The content provider for displaying cheat sheets. Used in both search console
+ * and search favorites
+ *
+ * @author danail
+ */
+public class CheatSheetContentProvider implements ITreeContentProvider {
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof ISearchContext) {
+ return getElements(((ISearchContext) inputElement).searchResult());
+ }
+ if (inputElement instanceof ICheatSheetCategory) {
+ return ((ICheatSheetCategory) inputElement).getChildren().toArray();
+ }
+ return new Object[0];
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ return getElements(parentElement);
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ if (element instanceof ICheatSheetItem) {
+ return ((ICheatSheetItem) element).getParent();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ return element instanceof ICheatSheetCategory && ((ICheatSheetCategory) element).getChildren().size() > 0;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.java
new file mode 100644
index 0000000..4d87ecc
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetCustomization.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view;
+
+import java.util.Arrays;
+import java.util.HashSet;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.ui.api.IGenericViewCustomization;
+import org.eclipse.platform.discovery.ui.api.IMasterDiscoveryView;
+import org.eclipse.platform.discovery.ui.api.IResultsViewAccessor;
+import org.eclipse.platform.discovery.ui.api.ITooltipProvider;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+import org.eclipse.wst.sse.sieditor.search.internal.slave.RunCheatSheetAction;
+import org.eclipse.wst.sse.sieditor.search.internal.text.Messages;
+
+/**
+ * The base implementation of cheat sheet view customization
+ *
+ * @author danail
+ */
+public class CheatSheetCustomization implements IGenericViewCustomization {
+ protected IMasterDiscoveryView masterView;
+
+ @Override
+ public ITreeContentProvider getContentProvider() {
+ return new CheatSheetContentProvider();
+ }
+
+ @Override
+ public ILabelProvider getLabelProvider() {
+ return new CheatSheetLabelProvider();
+ }
+
+ @Override
+ public ITooltipProvider getTooltipProvider() {
+ return new ConsoleTooltipProvider();
+ }
+
+ @Override
+ public void setMasterView(IMasterDiscoveryView masterView) {
+ this.masterView = masterView;
+ }
+
+ @Override
+ public void installAction(final IContributedAction contributedAction, final IResultsViewAccessor viewAccessor) {
+ if (contributedAction.getActionId().equals(RunCheatSheetAction.ACTION_ID)) {
+ final IStructuredSelection sel = (IStructuredSelection) viewAccessor.getTreeViewer().getSelection();
+ if (!(sel.getFirstElement() instanceof ICheatSheet)) {
+ return;
+ }
+
+ final IAction action = new Action(Messages.RunCheatSheetAction_Label) {
+ @Override
+ public void run() {
+ doRunCheatSheet(contributedAction, viewAccessor.getTreeViewer().getSelection());
+ }
+ };
+ viewAccessor.getMenuManager().add(action);
+ }
+
+ }
+
+ @Override
+ public IDoubleClickListener getDoubleClickListener() {
+ return new IDoubleClickListener() {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
+ doRunCheatSheet(new RunCheatSheetAction(), event.getSelection());
+ }
+ };
+ }
+
+ private void doRunCheatSheet(final IContributedAction runAction, final ISelection selection) {
+ if (!(selection instanceof IStructuredSelection)) {
+ return;
+ }
+
+ final Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (!(obj instanceof ICheatSheet)) {
+ return;
+ }
+
+ runAction
+ .perform(masterView.getEnvironment().operationRunner(), new HashSet<Object>(Arrays.asList(new Object[] { obj })));
+ }
+
+ @Override
+ public void postResultDisplayed(IResultsViewAccessor viewAccessor) {
+ viewAccessor.getTreeViewer().expandToLevel(2);
+ }
+
+ @Override
+ public void selectionChanged(ISelection selection) {
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.java
new file mode 100644
index 0000000..6ac20cf
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/CheatSheetLabelProvider.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
+import org.eclipse.ui.internal.cheatsheets.ICheatSheetResource;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetItem;
+
+/**
+ * The label provider for displaying cheat sheets
+ *
+ * @author danail
+ *
+ */
+@SuppressWarnings("restriction")
+public class CheatSheetLabelProvider implements ILabelProvider {
+ @Override
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ICheatSheetCategory) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
+ }
+
+ if (element instanceof ICheatSheet) {
+ final ICheatSheet cs = (ICheatSheet) element;
+ if (cs.isComposite()) {
+ return CheatSheetPlugin.getPlugin().getImageRegistry().get(ICheatSheetResource.COMPOSITE_OBJ);
+ }
+ return CheatSheetPlugin.getPlugin().getImageRegistry().get(ICheatSheetResource.CHEATSHEET_OBJ);
+ }
+
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ICheatSheetItem) {
+ return ((ICheatSheetItem) element).getName();
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.java
new file mode 100644
index 0000000..bdd2f19
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/ConsoleTooltipProvider.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view;
+
+import org.eclipse.platform.discovery.ui.api.IFormTextBuilder;
+import org.eclipse.platform.discovery.ui.api.ITooltipProvider;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+
+/**
+ * The provider of tooltip content for cheat sheet items
+ *
+ * @author danail
+ */
+public class ConsoleTooltipProvider implements ITooltipProvider {
+ @Override
+ public void createTooltipContent(IFormTextBuilder tooltipTextBuilder, Object element) {
+ if (element instanceof ICheatSheet) {
+ final ICheatSheet cs = (ICheatSheet) element;
+ tooltipTextBuilder.appendProperty("Name", cs.getName()); //$NON-NLS-1$
+ tooltipTextBuilder.startParagraph(true);
+ tooltipTextBuilder.appendText(cs.getDescription().trim());
+ tooltipTextBuilder.endParagraph();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.java
new file mode 100644
index 0000000..e5667f7
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/console/ConsoleCustomization.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view.console;
+
+import org.eclipse.platform.discovery.ui.api.ISearchConsoleCustomization;
+import org.eclipse.wst.sse.sieditor.search.internal.search.LocalCheatSheetSearchProvider;
+import org.eclipse.wst.sse.sieditor.search.internal.view.CheatSheetCustomization;
+
+/**
+ * The search console view customization
+ *
+ * @author danail
+ *
+ */
+public class ConsoleCustomization extends CheatSheetCustomization implements ISearchConsoleCustomization {
+ @Override
+ public boolean acceptSearchProvider(String searchProviderId) {
+ return searchProviderId.equals(LocalCheatSheetSearchProvider.class.getName());
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.java
new file mode 100644
index 0000000..d39aa20
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/ChatSheatGroupNode.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view.favorites;
+
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.CheatSheetCategoryImpl;
+import org.eclipse.wst.sse.sieditor.search.internal.text.Messages;
+
+/**
+ * Artificial node displayed as parent of all favorite cheat sheets
+ *
+ * @author danail
+ */
+public class ChatSheatGroupNode extends CheatSheetCategoryImpl {
+ public ChatSheatGroupNode() {
+ super(null, null);
+ }
+
+ @Override
+ public String getName() {
+ return Messages.FavoritesCustomization_CheatSheetGroupName;
+ }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.java
new file mode 100644
index 0000000..b1ee722
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/internal/view/favorites/FavoritesCustomization.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SAP AG.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Georgi Konstantinov - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.wst.sse.sieditor.search.internal.view.favorites;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.platform.discovery.core.api.IContributedAction;
+import org.eclipse.platform.discovery.ui.api.IResultsViewAccessor;
+import org.eclipse.platform.discovery.ui.api.ISearchFavoritesViewCustomization;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheet;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetCategory;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.ICheatSheetItem;
+import org.eclipse.wst.sse.sieditor.search.internal.runtime.RootCSItem;
+import org.eclipse.wst.sse.sieditor.search.internal.slave.DeleteFromFavoritesAction;
+import org.eclipse.wst.sse.sieditor.search.internal.text.Messages;
+import org.eclipse.wst.sse.sieditor.search.internal.view.CheatSheetCustomization;
+
+/**
+ * The search favorites view customization
+ *
+ * @author danail
+ *
+ */
+public class FavoritesCustomization extends CheatSheetCustomization implements ISearchFavoritesViewCustomization {
+ private static final ICheatSheetCategory CHEAT_SHEETS_GROUP_NODE = new RootCSItem() {
+ @Override
+ public String getName() {
+ return Messages.FavoritesCustomization_CheatSheetGroupName;
+ }
+ };
+
+ @Override
+ public Set<Object> itemsFor(Object itemsSource) {
+ if (itemsSource instanceof ICheatSheet) {
+ return new HashSet<Object>(Arrays.asList(new Object[] { itemsSource }));
+ }
+
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Object itemGroup(Object item) {
+ if (item instanceof ICheatSheet) {
+ return CHEAT_SHEETS_GROUP_NODE;
+ }
+
+ return null;
+ }
+
+ @Override
+ public void installAction(IContributedAction contributedAction, IResultsViewAccessor viewAccessor) {
+ super.installAction(contributedAction, viewAccessor);
+ if (contributedAction.getActionId().equals(DeleteFromFavoritesAction.ACTION_ID)) {
+ installDeleteCheatSheetMenuAction(contributedAction, viewAccessor);
+ }
+ }
+
+ private void installDeleteCheatSheetMenuAction(final IContributedAction contributedAction,
+ final IResultsViewAccessor viewAccessor) {
+ final IStructuredSelection selection = (IStructuredSelection) viewAccessor.getTreeViewer().getSelection();
+ if (selection.isEmpty() || selection.size() > 1) {
+ return;
+ }
+
+ final Object selectedObject = selection.getFirstElement();
+ if (!(selectedObject instanceof ICheatSheetItem)) {
+ return;
+ }
+
+ final Set<Object> oSet = new HashSet<Object>();
+ oSet.add(selectedObject);
+
+ final IAction action = new Action() {
+ @Override
+ public void run() {
+ contributedAction.perform(masterView.getEnvironment().operationRunner(), oSet);
+ }
+ };
+
+ action.setText(Messages.DeleteFromFavorites);
+
+ viewAccessor.getMenuManager().add(action);
+ }
+
+}