From 82298e409bf66fb2437ccc971322b4b266a33663 Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nie@informatik.uni-kiel.de>
Date: Thu, 30 Aug 2012 13:57:09 +0200
Subject: [PATCH] Continued with the integration of the FlowEditor.

---
 .../view/CurrentAnalysisEditorBeanV2.java      | 18 ++++++++++++++++++
 .../src/main/webapp/AnalysisEditor_V2.xhtml    |  5 +++++
 2 files changed, 23 insertions(+)

diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
index f0a92869..9815160c 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
@@ -615,6 +615,8 @@ public final class CurrentAnalysisEditorBeanV2 {
 		final RequestContext context = RequestContext.getCurrentInstance();
 		// Make sure that the graph exists in the first place
 		context.execute(CurrentAnalysisEditorBeanV2.JS_CMD_INIT_GRAPH);
+		// Initialize the listener for the clicks on the components
+		context.execute("graph.addListener(\"onClick\", function(node,info,e){document.getElementById('hiddenNode:clickedNodeID').value = node.id;document.getElementById('hiddenNode:link').click();});");
 
 		// Paint all necessary components
 		this.initializeGraphPlugins();
@@ -640,6 +642,22 @@ public final class CurrentAnalysisEditorBeanV2 {
 		// TODO Now the connections between filters and repositories
 	}
 
+	public void setClickedNodeID(final String id) {
+		System.out.println("clicked: " + id);
+	}
+
+	public String getClickedNodeID() {
+		return "";
+	}
+
+	public void setClickedNodeType(final String type) {
+		System.out.println("clicked: " + type);
+	}
+
+	public String getClickedNodeType() {
+		return "";
+	}
+
 	/**
 	 * This method initializes the modified jit-graph by delivering the necessary javascript commands to paint the repository components.
 	 */
diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml
index 67618535..b999aa28 100644
--- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml
+++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor_V2.xhtml
@@ -36,6 +36,11 @@
                 <f:ajax event="click" listener="#{currentAnalysisEditorBeanV2.initializeGraph()}" />
             </h:commandLink>
         </h:form>
+        <h:form id="hiddenNode" style="display:none">
+            <h:inputHidden id="clickedNodeID" value="#{currentAnalysisEditorBeanV2.clickedNodeID}"/>
+            <h:inputHidden id="clickedNodeType" value="#{currentAnalysisEditorBeanV2.clickedNodeType}"/>
+            <p:commandButton id="link" ajax="true" value="submit"/>
+        </h:form>
 
         <p:layout id="layout" fullPage="true">
 
-- 
GitLab