diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java index 295b777c521fc30b816bf5ccef5375a7a0d80621..0e4e6465981403c739496a7ef4a63325875f37ca 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/AvailableProjectsBean.java @@ -33,6 +33,7 @@ import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.webgui.beans.session.SelectedProjectBean; import kieker.webgui.common.FileManager; +import org.primefaces.event.ToggleEvent; import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.TreeNode; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentPlugin.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentPlugin.java new file mode 100644 index 0000000000000000000000000000000000000000..6ac84137a1bf174924da12759c438c11133949f5 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentPlugin.java @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright 2012 by + * + Christian-Albrechts-University of Kiel + * + Department of Computer Science + * + Software Engineering Group + * and others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.beans.session; + +import javax.faces.application.FacesMessage; +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; +import kieker.analysis.model.analysisMetaModel.MIPlugin; +import kieker.analysis.model.analysisMetaModel.MIProperty; +import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; + +/** + * + * @author Nils Christian Ehmke + */ +@ManagedBean +@SessionScoped +public class CurrentPlugin { + + private MIPlugin plugin; + + public CurrentPlugin() {} + + public MIPlugin getPlugin() { + return plugin; + } + + public void setPlugin(MIPlugin plugin) { + this.plugin = plugin; + } +} diff --git a/Kieker.WebGUI/src/main/webapp/main.xhtml b/Kieker.WebGUI/src/main/webapp/main.xhtml index 43945563355ce4fd92e45984695ff6b0b6db431a..2300c5af1e9349f7557a411a474c2febfca5b717 100644 --- a/Kieker.WebGUI/src/main/webapp/main.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main.xhtml @@ -4,7 +4,8 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.org/ui"> + xmlns:p="http://primefaces.org/ui" + xmlns:c="http://java.sun.com/jsp/jstl/core"> <f:view contentType="text/html"> <h:head> @@ -79,7 +80,7 @@ <p:contextMenu for="projectsTree" nodeType="project"> <p:menuitem value="Save Project" ajax="true" action="#{availableProjectsBean.saveProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm" /> - <p:menuitem value="Set as Main Project" ajax="true" action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm :toolpalette" /> + <p:menuitem value="Set as Main Project" ajax="true" action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm :toolpalette :centerForm" /> <p:separator /> <p:menuitem value="Delete Project" ajax="true" onclick="deleteProjectDialog.show()" /> @@ -101,45 +102,34 @@ <!-- ******************************************************************************** --> <!-- The following layout unit is within the center and used for the graph. --> <p:layoutUnit position="center" id="centerLayout"> - <ui:repeat id="centerRepeat" value="#{selectedProjectBean.mainProject.plugins}" var="plugin"> - <p:panel header="#{plugin.name}" id="plugin" style="width: 30%"/> - <p:draggable for="plugin"/> - </ui:repeat> + <h:form id="centerForm"> + <ui:repeat id="centerRepeat" value="#{selectedProjectBean.mainProject.plugins}" var="plugin"> + <p:panel header="#{plugin.name}" closable="true" closeSpeed="200" toggleSpeed="200" toggleable="true" id="plugin" style="width: 30%"> + <p:commandLink ajax="true" value="Configure" action="#{currentPlugin.setPlugin(plugin)}" update=":propertiesForm"/> + </p:panel> + <p:draggable for="plugin"> + </p:draggable> + </ui:repeat> + </h:form> </p:layoutUnit> <!-- ******************************************************************************** --> <!-- ******************************************************************************** --> <!-- The following layout unit is located at the bottom and will be used for properties. --> <p:layoutUnit position="south" size="150" header="Properties" resizable="true" collapsible="true"> - <h:form> - <p:dataTable id="propertiesList"> - <p:column headerText="Key" style="width:125px"> - <p:cellEditor> - <f:facet name="output"> - <h:outputText value="" /> - </f:facet> - <f:facet name="input"> - <p:inputText value="" style="width:100%" /> - </f:facet> - </p:cellEditor> - </p:column> - - <p:column headerText="Value" style="width:125px"> - <p:cellEditor> - <f:facet name="output"> - <h:outputText value="" /> - </f:facet> - <f:facet name="input"> - <p:inputText value="" style="width:100%" label="Year" /> - </f:facet> - </p:cellEditor> - </p:column> - - <p:column headerText="Options" style="width:50px"> - <p:rowEditor /> - </p:column> - - </p:dataTable> + <h:form id="propertiesForm"> + <c:if test="#{not empty currentPlugin.plugin}"> + <p:dataTable value="#{currentPlugin.plugin.properties}" var="property" id="propertiesList"> + <p:column headerText="Key" style="width:125px"> + <h:outputText value="#{property.name}"/> + </p:column> + + <p:column headerText="Value" style="width:125px"> + <h:outputText value="#{property.value}"/> + </p:column> + + </p:dataTable> + </c:if> </h:form> </p:layoutUnit> <!-- ******************************************************************************** --> @@ -152,12 +142,12 @@ <p:accordionPanel multiple="true" activeIndex=""> <p:tab title="Reader"> <ui:repeat value="#{selectedProjectBean.availableReaders}" var="reader"> - <p:commandLink value="#{reader.simpleName}" action="#{selectedProjectBean.addPlugin(reader)}" update=":projectsForm :centerLayout" /><br/> + <p:commandLink value="#{reader.simpleName}" action="#{selectedProjectBean.addPlugin(reader)}" update=":projectsForm :centerForm" /><br/> </ui:repeat> </p:tab> <p:tab title="Filter"> <ui:repeat value="#{selectedProjectBean.availableFilters}" var="filter"> - <p:commandLink value="#{filter.simpleName}" action="#{selectedProjectBean.addPlugin(filter)}" update=":projectsForm :centerLayout"/><br/> + <p:commandLink value="#{filter.simpleName}" action="#{selectedProjectBean.addPlugin(filter)}" update=":projectsForm :centerForm"/><br/> </ui:repeat> </p:tab> </p:accordionPanel>