From ce1b101cdf63bc620765dae48092d9c3fd261f5c Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nie@informatik.uni-kiel.de>
Date: Sun, 21 Oct 2012 14:28:07 +0200
Subject: [PATCH] Continued with the cockpit editor.

---
 .../lang/CockpitEditorPage_de.properties      |  7 +++++-
 .../lang/CockpitEditorPage_en.properties      |  7 +++++-
 .../src/main/webapp/CockpitEditorPage.xhtml   | 25 +++++++++++--------
 .../src/main/webapp/css/CockpitEditorPage.css |  7 +++++-
 4 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties
index c7f54336..bdab2198 100644
--- a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties
+++ b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties
@@ -3,4 +3,9 @@
 # Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., 
 # welche innerhalb der Seite des Cockpiteditors benutzt werden.
 #
-#------------------------------------------------------------------------------
\ No newline at end of file
+#------------------------------------------------------------------------------
+
+selectView = Ansicht Selektieren
+copyView = Ansicht Kopieren
+renameView = Ansicht Umbenennen
+deleteView = Ansicht Löschen
\ No newline at end of file
diff --git a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_en.properties b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_en.properties
index 34776ea9..99b6681c 100644
--- a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_en.properties
+++ b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_en.properties
@@ -3,4 +3,9 @@
 # This file contains all messages, button captions etc. which are used within
 # the cockpit editor page.
 #
-#------------------------------------------------------------------------------
\ No newline at end of file
+#------------------------------------------------------------------------------
+
+selectView = Select View
+copyView = Copy View
+renameView = Rename View
+deleteView = Delete View
\ No newline at end of file
diff --git a/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml b/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml
index d54c29bd..ab763715 100644
--- a/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml
+++ b/Kieker.WebGUI/src/main/webapp/CockpitEditorPage.xhtml
@@ -33,14 +33,14 @@
                         <p:toolbarGroup align="right">
                             <p:button styleClass="perspective-button" icon="ui-icon-home" outcome="projectOverview" />
                             <p:separator/>
-                            <p:button styleClass="perspective-button" icon="ui-icon-analysisEditor" value="#{localizedMessages.analysisEditor}" style="white-space: none" disabled="true">
-                                  <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
+                            <p:button styleClass="perspective-button" icon="ui-icon-analysisEditor" value="#{localizedMessages.analysisEditor}" style="white-space: none" outcome="analysisEditor">
+                                <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
                             </p:button>
                             <p:button styleClass="perspective-button" icon="ui-icon-analysis" value="#{localizedMessages.analysis}" style="white-space: none" outcome="controller">
                                 <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
                             </p:button>
                             <p:separator/>
-                            <p:button styleClass="perspective-button" icon="ui-icon-cockpitEditor" value="#{localizedMessages.cockpitEditor}" style="white-space: none" outcome="cockpitEditor" disabled="true"/>
+                            <p:button styleClass="perspective-button" icon="ui-icon-cockpitEditor" value="#{localizedMessages.cockpitEditor}" style="white-space: none" disabled="true"/>
                             <p:button styleClass="perspective-button" icon="ui-icon-cockpit" value="#{localizedMessages.cockpit}" style="white-space: none" outcome="cockpit">
                                 <f:param name="projectName" value="#{currentCockpitEditorBean.projectName}" rendered="#{not empty currentCockpitEditorBean.projectName}"/>
                             </p:button>
@@ -75,14 +75,17 @@
 
             <p:layoutUnit position="west" resizable="true" size="300" collapsible="true" header="Available Views">
                 <h:form id="availableViewsForm">
-                    <p:dataTable value="#{currentCockpitEditorBean.project.views}" var="viewElem">
-                        <p:column headerText="View Name" style="font-weight: #{currentCockpitEditorBean.activeView == viewElem ? 'bold' : 'normal'}">
-                            <p:commandLink value="#{viewElem.name}" action="#{currentCockpitEditorBean.setActiveView(viewElem)}" update=":availableViewsForm :centerForm"/>
-                        </p:column>
-                        <p:column headerText="# Displays">
-                            #{viewElem.displayConnectors.size()}
-                        </p:column>
-                    </p:dataTable>
+                    <p:dataList value="#{currentCockpitEditorBean.project.views}" var="viewElem"> 
+                            <p:commandLink id="dynaButton" value="#{viewElem.name}"/>
+
+                            <p:menu overlay="true" trigger="dynaButton" my="left top" at="left bottom" style="width:210px">        
+                                <p:menuitem icon="ui-icon-analysisEditor" value="  #{localizedCockpitEditorPageMessages.selectView}" action="#{currentCockpitEditorBean.setActiveView(viewElem)}" styleClass="element-with-whitespace" update=":messages :centerForm"/>
+                                <p:separator/>
+                                <p:menuitem  icon="ui-icon-copy"  styleClass="element-with-whitespace" value="  #{localizedCockpitEditorPageMessages.copyView}" />
+                                <p:menuitem  icon="ui-icon-edit"  styleClass="element-with-whitespace" value="  #{localizedCockpitEditorPageMessages.renameView}"/>
+                                <p:menuitem  icon="ui-icon-delete"  styleClass="element-with-whitespace" value="  #{localizedCockpitEditorPageMessages.deleteView}"/> 
+                            </p:menu>
+                    </p:dataList>
                 </h:form>
             </p:layoutUnit>
 
diff --git a/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css b/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css
index 03bb3631..b8ba3d16 100644
--- a/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css
+++ b/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css
@@ -1 +1,6 @@
-@charset "UTF-8";
\ No newline at end of file
+@charset "UTF-8";
+
+/* This is necessary to remove the border from the datalist */
+.ui-datalist * {
+    border : 0px !important;
+}
\ No newline at end of file
-- 
GitLab