Bug 547156: [R-Help] Add documentation for R help icons

  - Add help context for R help view

Change-Id: Ic8cbbdf57f3f22e365e21939b2b64281ada24618
diff --git a/r/org.eclipse.statet.r.doc/contexts_R.xml b/r/org.eclipse.statet.r.doc/contexts_R.xml
index 44a5c34..4e74c23 100644
--- a/r/org.eclipse.statet.r.doc/contexts_R.xml
+++ b/r/org.eclipse.statet.r.doc/contexts_R.xml
@@ -73,6 +73,11 @@
 		<topic href="reference/r_cmd-tools.xhtml"
 				label="R CMD Tools" />
 	</context>
+	<context id="r_help-view" title="About R Help View">
+		<description>This view allows to browse the R help contents.</description>
+		<topic href="reference/r_help.xhtml"
+				label="R Help" />
+	</context>
 	<context id="r_help-search_page">
 		<description>Type a pattern and/or expression for which you want to search in R help documents.</description>
 		<topic href="reference/r_help-search.xhtml"
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/renv.png b/r/org.eclipse.statet.r.doc/icons/obj/renv.png
new file mode 100644
index 0000000..a2da588
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/renv.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page-internal.png b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page-internal.png
new file mode 100644
index 0000000..fee86c4
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page-internal.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page.png b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page.png
new file mode 100644
index 0000000..5b36bcd
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-page.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic-internal.png b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic-internal.png
new file mode 100644
index 0000000..225ea14
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic-internal.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic.png b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic.png
new file mode 100644
index 0000000..36693b6
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/rhelp-topic.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/icons/obj/rpackage.png b/r/org.eclipse.statet.r.doc/icons/obj/rpackage.png
new file mode 100644
index 0000000..50d891e
--- /dev/null
+++ b/r/org.eclipse.statet.r.doc/icons/obj/rpackage.png
Binary files differ
diff --git a/r/org.eclipse.statet.r.doc/reference/r_help.xhtml b/r/org.eclipse.statet.r.doc/reference/r_help.xhtml
index 019b167..19ce61e 100644
--- a/r/org.eclipse.statet.r.doc/reference/r_help.xhtml
+++ b/r/org.eclipse.statet.r.doc/reference/r_help.xhtml
@@ -14,9 +14,52 @@
 
 <h2 class="NavListTitle">Contents</h2>
 <ul class="NavList">
-<li><a href="r_help-search.xhtml">Search</a></li>
+	<li><a href="#overview">Overview</a></li>
+	<li><a href="r_help-search.xhtml">Search</a></li>
 </ul>
 
+
+<h2 id="overview">Overview</h2>
+
+<h3>Overview of R Help Elements</h3>
+<table class="style1">
+<tr>
+	<td id="renv"><img src="../icons/obj/renv.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>R Environment</td>
+	<td>An <a href="r_env.xhtml">R environment</a>. In the context of the R help it provides
+		access to the documentations of the R installation itself and
+		lists the R package helps.</td>
+</tr>
+<tr>
+	<td id="rpackage"><img src="../icons/obj/rpackage.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>R Package Help</td>
+	<td>An overview of the help content of an R package.</td>
+</tr>
+<tr>
+	<td id="rhelp-page"><img src="../icons/obj/rhelp-page.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>R Help Page</td>
+	<td>An R help page.</td>
+</tr>
+<tr>
+	<td><img src="../icons/obj/rhelp-page-internal.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>Internal R Help Page</td>
+	<td>An R help page marked as internal by the keyword <code>internal</code>.
+		Internal content can be shown/hidden in the R Help view by the appropriate action in the
+		view menu.</td>
+</tr>
+<tr>
+	<td id="rhelp-topic"><img src="../icons/obj/rhelp-topic.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>R Help Topic</td>
+	<td>A specific topic of R help pages.</td>
+</tr>
+<tr>
+	<td><img src="../icons/obj/rhelp-topic-internal.png" alt="Icon" style="vertical-align: text-top"/></td>
+	<td>Internal R Help Topic</td>
+	<td>A specific topic of solely internal R help pages.</td>
+</tr>
+</table>
+
+
 <h2 id="related">&mdash;</h2>
 <h3>Related topics</h3>
 <ul class="NavList">
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/help/IRUIHelpContextIds.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/help/IRUIHelpContextIds.java
index 2dd4c93..4cecbe3 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/help/IRUIHelpContextIds.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/help/IRUIHelpContextIds.java
@@ -26,6 +26,7 @@
 	
 	public static final String R_ENV = RUI.BUNDLE_ID + ".r_env"; //$NON-NLS-1$
 	
+	public static final String R_HELP_VIEW = RUI.BUNDLE_ID + ".r_help-view"; //$NON-NLS-1$
 	public static final String R_HELP_SEARCH_PAGE = RUI.BUNDLE_ID + ".r_help-search_page"; //$NON-NLS-1$
 	
 }
diff --git a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/rhelp/RHelpView.java b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/rhelp/RHelpView.java
index 9c87ada..5e2394d 100644
--- a/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/rhelp/RHelpView.java
+++ b/r/org.eclipse.statet.r.ui/src/org/eclipse/statet/internal/r/ui/rhelp/RHelpView.java
@@ -81,6 +81,7 @@
 import org.eclipse.statet.ecommons.ui.workbench.ContextHandlers;
 
 import org.eclipse.statet.internal.r.debug.ui.RLaunchingMessages;
+import org.eclipse.statet.internal.r.ui.help.IRUIHelpContextIds;
 import org.eclipse.statet.internal.r.ui.rhelp.RequestSync.RequestKey;
 import org.eclipse.statet.ltk.ast.core.util.AstSelection;
 import org.eclipse.statet.ltk.ui.ISelectionWithElementInfoListener;
@@ -253,6 +254,9 @@
 			job.schedule(50);
 		}
 		
+		
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook(), IRUIHelpContextIds.R_HELP_VIEW);
+		
 		initLinking();
 	}