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

Started with the selection of plugins; Properties can now be seen.

parent 827d5a08
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
/***************************************************************************
* 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;
}
}
......@@ -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>
......
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