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

Removed bugs; Modified and added details.

parent 9bb79095
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@
package kieker.webgui.beans.session;
import java.awt.Point;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
......@@ -28,6 +29,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
......@@ -55,9 +57,11 @@ import kieker.webgui.common.PluginClassLoader;
import kieker.webgui.common.PluginFinder;
import org.eclipse.emf.common.util.EList;
import org.primefaces.event.DragDropEvent;
/**
* This session bean stores the currently selected main project of the user and provides different methods to access and manipulate the properties of this project.
* It is possible that this bean accesses other beans directly.
*
* @author Nils Christian Ehmke
* @version 1.0
......@@ -94,11 +98,14 @@ public class SelectedMainProjectBean {
*/
private List<Connection> connections;
private final ConcurrentHashMap<MIPlugin, Point> positions;
/**
* Creates a new instance of this class.
*/
public SelectedMainProjectBean() {
this.connections = new ArrayList<Connection>();
this.positions = new ConcurrentHashMap<MIPlugin, Point>();
}
/**
......@@ -337,13 +344,21 @@ public class SelectedMainProjectBean {
}
/**
* This method removes a given model plugin instance from the current main project.
* This method removes a given model plugin instance from the current main project. If this is the currently selected plugin from the user, it will be deselected
* as well. This means that this method accesses the <code>SelectedPluginBean</code> directly.
*
* @param plugin
* The project to be removed.
*/
public final void removePlugin(final MIPlugin plugin) {
this.mainProject.getPlugins().remove(plugin);
/* Get the currently selected plugin bean. */
final SelectedPluginBean selectedPluginBean = (SelectedPluginBean) FacesContext.getCurrentInstance().getExternalContext()
.getSessionMap().get("selectedPluginBean");
if (selectedPluginBean != null && selectedPluginBean.getPlugin() == plugin) {
selectedPluginBean.setPlugin((MIPlugin) null);
}
}
/**
......@@ -396,4 +411,5 @@ public class SelectedMainProjectBean {
}
}
}
}
......@@ -51,8 +51,8 @@
<p:layoutUnit position="south" header="Analysis" resizable="true" collapsible="true">
<h:form id="analysisForm">
<p:commandButton value="Instantiate Analysis" action="#{analysisControllerBean.instantiate(selectedProjectBean.selectedProject)}" update=":analysisForm:analysisStateText"/>
<p:commandButton value="Start Analysis" async="true" action="#{analysisControllerBean.controller.run()}" disabled="#{empty analysisControllerBean.controller}"/>
<p:commandButton value="Stop Analysis" async="true" action="#{analysisControllerBean.controller.terminate()}" disabled="#{empty analysisControllerBean.controller}"/>
<p:commandButton id="startAnalysisButton" value="Start Analysis" async="true" action="#{analysisControllerBean.controller.run()}" disabled="#{empty analysisControllerBean.controller}"/>
<p:commandButton id="stopAnalysisButton" value="Stop Analysis" async="true" action="#{analysisControllerBean.controller.terminate()}" disabled="#{empty analysisControllerBean.controller}"/>
<p:spacer height="0px" width="150px"/>
<c:choose>
<c:when test="#{empty analysisControllerBean.controller}">
......@@ -62,7 +62,7 @@
<h:outputText id="analysisStateText" value="Analysis State: #{analysisControllerBean.controller.state}"/>
</c:otherwise>
</c:choose>
<p:poll interval="2" update=":analysisForm:analysisStateText"/>
<p:poll interval="2" update=":analysisForm:analysisStateText :analysisForm:startAnalysisButton :analysisForm:stopAnalysisButton"/>
</h:form>
</p:layoutUnit>
......
......@@ -41,7 +41,7 @@
width: auto;
}
.projectInputText {
.projectInputText .pluginInputText {
width: 90%;
}
......
......@@ -112,11 +112,12 @@
<br/>
<p:commandLink ajax="true" value="Connect" update=":connectionDialogForm" onclick="connectionDialog.show();"/>
<br/>
<p:commandLink ajax="true" value="Rename"/>
<p:ajax event="close" listener="#{selectedMainProjectBean.removePlugin(plugin)}" update=":centerForm"/>
<p:commandLink ajax="true" value="Rename" action="#{selectedPluginBean.setPlugin(plugin)}" update=":propertiesForm" onclick="pluginRenamingDialog.show();"/>
<p:ajax event="close" listener="#{selectedMainProjectBean.removePlugin(plugin)}" update=":centerForm :propertiesForm" />
</p:panel>
<p:draggable for="plugin">
</p:draggable>
</ui:repeat>
</h:form>
</p:layoutUnit>
......@@ -193,6 +194,8 @@
<!-- 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
......@@ -54,8 +54,8 @@
</f:facet>
<f:facet name="input">
<h:selectOneMenu converter="kieker.webgui.converter.MIPluginToStringConverter" value="#{connection.destination}">
<f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}"
var="plugin"
<f:selectItems value="#{selectedMainProjectBean.mainProject.plugins}"
var="plugin"
itemLabel="#{plugin.name}"
itemValue="#{plugin}"/>
<p:ajax event="change" update=":connectionDialogForm"></p:ajax>
......
This diff is collapsed.
<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
......@@ -8,66 +8,58 @@
<!-- ******************************************************************************** -->
<!-- This is the dialog to create a new project. -->
<p:dialog id="newProjectDialog" header="New Project" resizable="false"
modal="true" widgetVar="newProjectDialog">
<p:dialog id="newProjectDialog" header="New Project" resizable="false" modal="true" widgetVar="newProjectDialog">
<!-- Make sure that closing of the dialog also clears the input field. -->
<p:ajax event="close" update="newProjectDialog" />
<p:ajax event="close" update="newProjectDialogForm:newProjectInputText" />
<h:form>
<h:outputText value="Please enter the name of the new project: " />
<br />
<br />
<center>
<p:inputText id="NewProjectInput" styleClass="projectInputText"
value="#{stringBean.string}" />
<br /> <br />
<p:commandButton value="Ok"
action="#{projectsBean.addProject(stringBean.string)}"
update=":projectsForm"
oncomplete="newProjectDialog.hide()" />
<p:spacer width="100" height="10" />
<h:form id="newProjectDialogForm">
<div style="text-align: center">
<h:outputText value="Name: " />
<p:inputText id="newProjectInputText" value="#{stringBean.string}" />
</div>
<hr/>
<div style="text-align: right">
<p:commandButton value="Ok" action="#{projectsBean.addProject(stringBean.string)}" update=":projectsForm" oncomplete="newProjectDialog.hide()" />
<p:spacer width="10px" height="10" />
<p:commandButton value="Cancel" onclick="newProjectDialog.hide()" />
</center>
</h:form>
</div>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
<!-- ******************************************************************************** -->
<!-- This is the dialog to delete the selected project. -->
<p:dialog id="deleteProjectDialog" header="Delete Project" resizable="false"
modal="true" widgetVar="deleteProjectDialog">
<p:dialog id="deleteProjectDialog" header="Delete Project" resizable="false" modal="true" widgetVar="deleteProjectDialog">
<h:form>
<h:outputText value="Do you really want to remove the selected project?" />
<br />
<br />
<center>
<p:commandButton value="Yes"
action="#{projectsBean.deleteProject(selectedProjectBean.getSelectedProject())}"
update=":projectsForm"
oncomplete="deleteProjectDialog.hide()" />
<p:spacer width="100" height="10" />
<div style="text-align: center">
<h:outputText value="Do you really want to remove the selected project?" />
</div>
<hr/>
<div style="text-align: right">
<p:commandButton value="Yes" action="#{projectsBean.deleteProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm" oncomplete="deleteProjectDialog.hide()" />
<p:spacer width="10px" height="10" />
<p:commandButton value="Cancel" onclick="deleteProjectDialog.hide()" />
</center>
</div>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
<!-- ******************************************************************************** -->
<!-- This is the dialog to reset the selected project. -->
<p:dialog id="resetProjectDialog" header="Reset Project" resizable="false"
modal="true" widgetVar="resetProjectDialog">
<p:dialog id="resetProjectDialog" header="Reset Project" resizable="false" modal="true" widgetVar="resetProjectDialog">
<h:form>
<h:outputText value="Do you really want to reset the selected project?" />
<br />
<br />
<center>
<p:commandButton value="Yes"
action="#{projectsBean.resetProject(selectedProjectBean.getSelectedProject())}"
update=":projectsForm"
oncomplete="resetProjectDialog.hide()" />
<p:spacer width="100" height="10" />
<div style="text-align: center">
<h:outputText value="Do you really want to reset the selected project?" />
</div>
<hr/>
<div style="text-align: right">
<p:commandButton value="Yes" action="#{projectsBean.resetProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm" oncomplete="resetProjectDialog.hide()" />
<p:spacer width="10px" height="10" />
<p:commandButton value="Cancel" onclick="resetProjectDialog.hide()" />
</center>
</div>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
......
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.0.12</center>
</body>
</html>
......@@ -18,9 +18,10 @@
<f:selectItems value="#{themeSwitcherBean.themes}" />
</p:themeSwitcher>
</h:panelGrid>
<center>
<hr/>
<div style="text-align: right">
<p:commandButton value="Ok" oncomplete="settingsDialog.hide();" />
</center>
</div>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
......
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