From a3dcbff271023ead1d1ba626dc32d0c8def10b3a Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nie@informatik.uni-kiel.de>
Date: Mon, 7 May 2012 21:14:38 +0200
Subject: [PATCH] Added simple tooltipps for the description of the plugins.

---
 .../webgui/beans/application/ProjectsBean.java       | 12 +++++++++++-
 Kieker.WebGUI/src/main/webapp/main.xhtml             |  6 ++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java
index 5d42d00a..e735c371 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java
@@ -31,6 +31,8 @@ import kieker.analysis.model.analysisMetaModel.MIDependency;
 import kieker.analysis.model.analysisMetaModel.MIPlugin;
 import kieker.analysis.model.analysisMetaModel.MIProject;
 import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory;
+import kieker.analysis.plugin.AbstractPlugin;
+import kieker.analysis.plugin.annotation.Plugin;
 import kieker.webgui.common.FileManager;
 
 import org.primefaces.context.RequestContext;
@@ -170,6 +172,15 @@ public class ProjectsBean extends Observable {
 		}
 	}
 
+    public String getDescription(final Class<? super AbstractPlugin> pluginClass) {
+        Plugin annotation = pluginClass.getAnnotation(Plugin.class);
+        if (annotation == null || annotation.description().isEmpty()) {
+            return "No description available";
+        } else {
+            return annotation.description();
+        }
+    }
+    
 	/**
 	 * This helper class is a wrapper for a project and can be send to the observers as a message that a project just has been removed. It contains
 	 * the removed project.
@@ -201,5 +212,4 @@ public class ProjectsBean extends Observable {
 			return this.project;
 		}
 	}
-
 }
diff --git a/Kieker.WebGUI/src/main/webapp/main.xhtml b/Kieker.WebGUI/src/main/webapp/main.xhtml
index 56ab9849..fc9dd9bb 100644
--- a/Kieker.WebGUI/src/main/webapp/main.xhtml
+++ b/Kieker.WebGUI/src/main/webapp/main.xhtml
@@ -184,12 +184,14 @@
                         <p:accordionPanel multiple="true" activeIndex="">
                             <p:tab title="Reader">
                                 <ui:repeat value="#{selectedMainProjectBean.availableReaders}" var="reader">
-                                    <p:commandLink value="#{reader.simpleName}" action="#{selectedMainProjectBean.addPlugin(reader)}" update=":projectsForm :centerForm" /><br/>
+                                    <p:commandLink id="readerLink" value="#{reader.simpleName}" action="#{selectedMainProjectBean.addPlugin(reader)}" update=":projectsForm :centerForm" /><br/>
+                                    <p:tooltip style="font-size: 15px" for="readerLink" value="#{projectsBean.getDescription(reader)}"/>
                                 </ui:repeat>
                             </p:tab>
                             <p:tab title="Filter">
                                 <ui:repeat value="#{selectedMainProjectBean.availableFilters}" var="filter">
-                                    <p:commandLink value="#{filter.simpleName}" action="#{selectedMainProjectBean.addPlugin(filter)}" update=":projectsForm :centerForm"/><br/>
+                                    <p:commandLink id="filterLink" value="#{filter.simpleName}" action="#{selectedMainProjectBean.addPlugin(filter)}" update=":projectsForm :centerForm"/><br/>
+                                    <p:tooltip style="font-size: 15px" for="filterLink" value="#{projectsBean.getDescription(filter)}"/>
                                 </ui:repeat>
                             </p:tab>
                             <p:tab title="Repositories">
-- 
GitLab