Skip to content
Snippets Groups Projects
Commit ae120c5e authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

The name is now a property of the plugin; The connections are configurable for a project.

parent 8c2eebc2
No related branches found
No related tags found
No related merge requests found
......@@ -64,4 +64,7 @@ public class StringBean {
this.string = string;
}
public boolean checkString(final Object object) {
return object instanceof String;
}
}
......@@ -20,6 +20,8 @@
package kieker.webgui.beans.session;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
......@@ -65,4 +67,13 @@ public final class SelectedPluginBean {
public void setPlugin(final MIPlugin plugin) {
this.plugin = plugin;
}
public List<Object> getAdvancedProperties() {
final List<Object> resultList = new ArrayList<Object>();
resultList.add(plugin.getName());
resultList.addAll(plugin.getProperties());
return resultList;
}
}
......@@ -48,6 +48,7 @@
<p:menuitem value="Reset Project" ajax="true" onclick="resetProjectDialog.show()" />
<p:separator />
<p:menuitem value="Configure Dependencies" ajax="false" url="/Kieker.WebGUI/projectDependencies" />
<p:menuitem ajax="true" value="Configure Connections" update=":connectionDialogForm" onclick="connectionDialog.show();"/>
<p:separator />
<p:menuitem value="Analysis" ajax="false" url="/Kieker.WebGUI/handleAnalysis" />
</p:submenu>
......@@ -98,6 +99,7 @@
<p:menuitem value="Reset Project" ajax="true" onclick="resetProjectDialog.show()" />
<p:separator />
<p:menuitem value="Configure Dependencies" ajax="false" url="/Kieker.WebGUI/projectDependencies" />
<p:menuitem ajax="true" value="Configure Connections" update=":connectionDialogForm" onclick="connectionDialog.show();"/>
<p:separator />
<p:menuitem value="Analysis" ajax="false" url="/Kieker.WebGUI/handleAnalysis" />
</p:contextMenu>
......@@ -122,11 +124,7 @@
<div class="ui-panel-titlebar ui-widget-header ui-corner-all">
<h:outputText style="font-weight: bold" value="#{plugin.getName()}"/>
</div>
<p:commandLink ajax="true" value="Configure" action="#{selectedPluginBean.setPlugin(plugin)}" update=":propertiesForm"/>
<br/>
<p:commandLink ajax="true" value="Connect" update=":connectionDialogForm" onclick="connectionDialog.show();"/>
<br/>
<p:commandLink ajax="true" value="Rename" action="#{selectedPluginBean.setPlugin(plugin)}" update=":propertiesForm" onclick="pluginRenamingDialog.show();"/>
<p:commandLink ajax="true" value="Configure" action="#{selectedPluginBean.setPlugin(plugin)}" update=":propertiesForm"/>
<br/>
<p:commandLink ajax="true" value="Remove" action="#{selectedMainProjectBean.removePlugin(plugin)}" update=":propertiesForm"/>
</div>
......@@ -149,18 +147,21 @@
<p:layoutUnit position="south" size="150" header="Properties" resizable="true" collapsible="true">
<h:form id="propertiesForm">
<c:if test="#{not empty selectedPluginBean.plugin}">
<p:dataTable value="#{selectedPluginBean.plugin.properties}" var="property" id="propertiesList">
<p:dataTable value="#{selectedPluginBean.advancedProperties}" var="property" id="propertiesList" emptyMessage="No properties available">
<p:column headerText="Key" style="width:125px">
<h:outputText value="#{property.name}"/>
<h:outputText value="#{property.name}" rendered="#{not stringBean.checkString(property)}"/>
<h:outputText value="Name" rendered="#{stringBean.checkString(property)}"/>
</p:column>
<p:column headerText="Value" style="width:125px">
<p:cellEditor >
<f:facet name="output">
<h:outputText value="#{property.value}"/>
<h:outputText value="#{property.value}" rendered="#{not stringBean.checkString(property)}"/>
<h:outputText value="#{selectedPluginBean.plugin.name}" rendered="#{stringBean.checkString(property)}"/>
</f:facet>
<f:facet name="input">
<h:inputText value="#{property.value}"/>
<h:inputText value="#{property.value}" rendered="#{not stringBean.checkString(property)}"/>
<h:inputText value="#{selectedPluginBean.plugin.name}" rendered="#{stringBean.checkString(property)}"/>
</f:facet>
</p:cellEditor>
</p:column>
......@@ -168,7 +169,8 @@
<p:column headerText="Options" style="width:50px">
<p:rowEditor />
</p:column>
<p:ajax event="rowEdit" update=":centerForm" />
</p:dataTable>
</c:if>
</h:form>
......@@ -215,8 +217,6 @@
<!-- Include the dialog to handle the connections. -->
<ui:include src="main/connectionDialog.xhtml" />
<ui:include src="main/pluginDialogs.xhtml" />
</h:body>
</f:view>
</html>
\ No newline at end of file
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<!-- ******************************************************************************** -->
<!-- This is the dialog to rename the currently selected plugin. -->
<p:dialog id="pluginRenamingDialog" header="Rename Plugin" resizable="false" modal="true" widgetVar="pluginRenamingDialog">
<!-- Make sure that closing the dialog also clears the input field. -->
<p:ajax event="close" update="pluginRenamingDialogForm:newNameInputText" />
<h:form id="pluginRenamingDialogForm">
<div style="text-align: center">
<h:outputText value="New Name: " />
<p:inputText id="newNameInputText" value="#{stringBean.string}" />
</div>
<hr/>
<div style="text-align: right">
<p:commandButton value="Ok" action="#{selectedPluginBean.plugin.setName(stringBean.string)}" update=":centerForm" oncomplete="pluginRenamingDialog.hide()" />
<p:spacer width="10px" height="10" />
<p:commandButton value="Cancel" onclick="pluginRenamingDialog.hide()" />
</div>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
</ui:composition>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment