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

Refactoring

parent 8d6e0333
No related branches found
No related tags found
No related merge requests found
...@@ -102,4 +102,16 @@ public class AvailableProjectsBean { ...@@ -102,4 +102,16 @@ public class AvailableProjectsBean {
return root; return root;
} }
public synchronized void saveProject(final MIProject project) {
}
public synchronized void deleteProject(final MIProject project) {
}
public synchronized void resetProject(final MIProject project) {
}
} }
...@@ -59,11 +59,5 @@ public class StringBean { ...@@ -59,11 +59,5 @@ public class StringBean {
public void setString(final String string) { public void setString(final String string) {
this.string = string; this.string = string;
} }
/**
* Clears the bean; in other words: Sets the value of this bean to an empty string.
*/
public void clear() {
this.string = "";
}
} }
...@@ -39,4 +39,12 @@ ...@@ -39,4 +39,12 @@
.ui-dialog { .ui-dialog {
font-size: 15px; font-size: 15px;
width: auto; width: auto;
}
.projectInputText {
width: 90%;
}
.ui-tree {
width: auto;
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html" 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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"> xmlns:p="http://primefaces.org/ui">
...@@ -21,34 +22,25 @@ ...@@ -21,34 +22,25 @@
<h:form> <h:form>
<p:menubar> <p:menubar>
<p:submenu label="File"> <p:submenu label="File">
<p:menuitem value="New Project" onclick="newProjectDialog.show()" <p:menuitem value="New Project" onclick="newProjectDialog.show()" ajax="true" />
ajax="true" /> <p:menuitem value="Manage Dependencies" ajax="false" url="/Kieker.WebGUI/manageDependencies" />
<p:menuitem value="Manage Dependencies" ajax="false"
url="/Kieker.WebGUI/manageDependencies" />
<p:separator /> <p:separator />
<p:menuitem value="Settings" onclick="settingsDialog.show()" ajax="true" />
<p:menuitem value="Settings" onclick="settingsDialog.show()"
ajax="true" />
</p:submenu> </p:submenu>
<!-- This is the submenu for the current project, for example if someone doesn't want to use the context menu within the browser. --> <!-- This is the submenu for the current project, for example if someone doesn't want to use the context menu within the browser. -->
<p:submenu label="Current Project"> <p:submenu label="Current Project">
<p:menuitem value="Save Project" ajax="true" /> <p:menuitem value="Save Project" ajax="true" action="#{availableProjectsBean.saveProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:menuitem value="Set as Main Project" ajax="true" <p:menuitem value="Set as Main Project" ajax="true" action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm" />
action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}"
update="projectsForm" />
<p:separator /> <p:separator />
<p:menuitem value="Delete Project" ajax="true" action="#{availableProjectsBean.deleteProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:menuitem value="Delete Project" ajax="true" /> <p:menuitem value="Reset Project" ajax="true" action="#{availableProjectsBean.resetProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:menuitem value="Reset Project" ajax="true" />
<p:separator /> <p:separator />
<p:menuitem value="Configure Dependencies" ajax="false" url="/Kieker.WebGUI/projectDependencies" />
<p:menuitem value="Configure Dependencies" ajax="false"
url="/Kieker.WebGUI/projectDependencies" />
</p:submenu> </p:submenu>
<p:submenu label="Help"> <p:submenu label="Help">
<p:menuitem value="About..." onclick="AboutDialog.show();" /> <p:menuitem value="About..." ajax="true" onclick="AboutDialog.show();" />
</p:submenu> </p:submenu>
</p:menubar> </p:menubar>
...@@ -59,43 +51,42 @@ ...@@ -59,43 +51,42 @@
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
<!-- The following layout is at the left side of the page and shows the available projects. --> <!-- The following layout is at the left side of the page and shows the available projects. -->
<p:layoutUnit id="projectsLayout" header="Projects" collapsible="true" position="west" <p:layoutUnit header="Projects" collapsible="true" position="west"
size="200" resizable="true" minSize="100"> size="200" resizable="true" minSize="100">
<h:form id="projectsForm"> <h:form id="projectsForm">
<p:tree selection="#{selectedProjectBean.selectedNode}" <p:tree selection="#{selectedProjectBean.selectedNode}" id="projectsTree" selectionMode="single" value="#{availableProjectsBean.projectsRoot}" var="node">
id="projectsTree" selectionMode="single" style="width: auto"
value="#{availableProjectsBean.projectsRoot}" var="node">
<p:ajax event="select" listener="#{selectedProjectBean.onNodeSelect}"/> <p:ajax event="select" listener="#{selectedProjectBean.onNodeSelect}"/>
<p:treeNode type="project"> <p:treeNode type="project">
<h:outputText <h:outputText style="font-weight: #{selectedProjectBean.getFontWeight(node)}" value="#{node}">
style="font-weight: #{selectedProjectBean.getFontWeight(node)}"
value="#{node}">
<f:converter <f:converter
converterId="kieker.webgui.converter.MIProjectToStringConverter" /> converterId="kieker.webgui.converter.MIProjectToStringConverter" />
</h:outputText> </h:outputText>
</p:treeNode> </p:treeNode>
<p:treeNode type="dependencies"> <p:treeNode type="dependencies">
<h:outputText value="#{node}" /> <h:outputText value="#{node}" />
</p:treeNode> </p:treeNode>
<p:treeNode type="usedPlugins"> <p:treeNode type="usedPlugins">
<h:outputText value="#{node}" /> <h:outputText value="#{node}" />
</p:treeNode> </p:treeNode>
</p:tree> </p:tree>
<p:contextMenu for="projectsTree" nodeType="project"> <p:contextMenu for="projectsTree" nodeType="project">
<p:menuitem value="Save Project" ajax="true" /> <p:menuitem value="Save Project" ajax="true" action="#{availableProjectsBean.saveProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:menuitem value="Set as Main Project" ajax="true" <p:menuitem value="Set as Main Project" ajax="true" action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}" update=":projectsForm" />
action="#{selectedProjectBean.setMainProject(selectedProjectBean.getSelectedProject())}"
update="projectsForm" />
<p:separator /> <p:separator />
<p:menuitem value="Delete Project" ajax="true" /> <p:menuitem value="Delete Project" ajax="true" action="#{availableProjectsBean.deleteProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:menuitem value="Reset Project" ajax="true" /> <p:menuitem value="Reset Project" ajax="true" action="#{availableProjectsBean.resetProject(selectedProjectBean.getSelectedProject)}" update=":projectsForm" />
<p:separator /> <p:separator />
<p:menuitem value="Configure Dependencies" ajax="true" /> <p:menuitem value="Configure Dependencies" ajax="false" url="/Kieker.WebGUI/projectDependencies" />
</p:contextMenu> </p:contextMenu>
<p:contextMenu for="projectsTree" nodeType="dependencies"> <p:contextMenu for="projectsTree" nodeType="dependencies">
</p:contextMenu> </p:contextMenu>
<p:contextMenu for="projectsTree" nodeType="usedPlugins"> <p:contextMenu for="projectsTree" nodeType="usedPlugins">
</p:contextMenu> </p:contextMenu>
</h:form> </h:form>
...@@ -111,12 +102,9 @@ ...@@ -111,12 +102,9 @@
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
<!-- The following layout unit is located at the bottom and will be used for properties. --> <!-- The following layout unit is located at the bottom and will be used for properties. -->
<p:layoutUnit position="south" size="150" header="Properties" <p:layoutUnit position="south" size="150" header="Properties" resizable="true" collapsible="true">
resizable="true" collapsible="true">
<h:form> <h:form>
<p:dataTable id="carList"> <p:dataTable id="propertiesList">
<p:column headerText="Key" style="width:125px"> <p:column headerText="Key" style="width:125px">
<p:cellEditor> <p:cellEditor>
<f:facet name="output"> <f:facet name="output">
...@@ -164,93 +152,15 @@ ...@@ -164,93 +152,15 @@
<!-- ******************************************************************************** --> <!-- ******************************************************************************** -->
</p:layout> </p:layout>
<!-- Include the dialogs for creating/deleting projects etc. -->
<ui:include src="main\projectDialogs.xhtml" />
<!-- ******************************************************************************** --> <!-- Include the dialog for the configuration. -->
<!-- This is the about-dialog. --> <ui:include src="main\settingsDialog.xhtml" />
<p:dialog header="About..." resizable="false" modal="true"
widgetVar="AboutDialog">
<h:form>
<h:outputText value="Kieker.WebGUI" />
<br />
<br />
<h:outputText value="Version: 1.0-SNAPSHOT" />
<br />
<h:outputText value="Copyright (c) 2012 Kieker Project" />
<br />
<br />
<a href="http://www.kieker-monitoring.net/">http://www.kieker-monitoring.net/</a>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
<!-- ******************************************************************************** -->
<!-- This is the dialog to create a new project. -->
<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"
listener="#{stringBean.clear()}" />
<h:form>
<h:outputText value="Please enter the name of the new project: " />
<br />
<br />
<center>
<p:inputText id="NewProjectInput" style="width: 90%"
value="#{stringBean.string}" />
<br /> <br />
<p:commandButton value="Ok"
action="#{availableProjectsBean.addProject(stringBean.string)}"
update="projectsForm"
oncomplete="newProjectDialog.hide()" />
<p:spacer width="100" height="10" />
<p:commandButton value="Cancel" onclick="newProjectDialog.hide()" />
</center>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
<!-- ******************************************************************************** --> <!-- Include the about-dialog. -->
<!-- This is the dialog for settings and properties. --> <ui:include src="main\aboutDialog.xhtml" />
<p:dialog id="settingsDialog" header="Settings" resizable="false"
modal="true" widgetVar="settingsDialog">
<h:form>
<h:panelGrid columns="2" cellpadding="10">
<h:outputText value="Look and Feel:" />
<p:themeSwitcher value="#{currentThemeBean.theme}"
style="width:150px" effect="fade">
<f:selectItem itemLabel="Choose Theme" itemValue="" />
<f:selectItems value="#{themeSwitcherBean.themes}" />
</p:themeSwitcher>
</h:panelGrid>
<center>
<p:commandButton value="Ok" oncomplete="settingsDialog.hide();" />
</center>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
<!-- ******************************************************************************** -->
<!-- This is the dialog for uploading dependencies. -->
<p:dialog id="dependenciesUploadDialog" header="Add Dependency"
resizable="false" modal="true" widgetVar="dependenciesUploadDialog">
<h:form enctype="multipart/form-data">
<p:messages showDetail="true" />
<p:fileUpload value="#{dependencyUploadController.file}"
mode="simple" />
<p:commandButton value="Submit" ajax="false"
actionListener="#{dependencyUploadController.upload}" />
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
</h:body> </h:body>
</f:view> </f:view>
</html> </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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<!-- ******************************************************************************** -->
<!-- This is the about-dialog. -->
<p:dialog header="About..." resizable="false" modal="true"
widgetVar="AboutDialog">
<h:form>
<h:outputText value="Kieker.WebGUI" />
<br />
<br />
<h:outputText value="Version: 1.0-SNAPSHOT" />
<br />
<h:outputText value="Copyright (c) 2012 Kieker Project" />
<br />
<br />
<a href="http://www.kieker-monitoring.net/">http://www.kieker-monitoring.net/</a>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
</ui:composition>
\ 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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<!-- ******************************************************************************** -->
<!-- This is the dialog to create a new project. -->
<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" />
<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="#{availableProjectsBean.addProject(stringBean.string)}"
update=":projectsForm"
oncomplete="newProjectDialog.hide()" />
<p:spacer width="100" height="10" />
<p:commandButton value="Cancel" onclick="newProjectDialog.hide()" />
</center>
</h:form>
</p:dialog>
<!-- ******************************************************************************** -->
</ui:composition>
\ 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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<!-- ******************************************************************************** -->
<!-- This is the dialog for settings and properties. -->
<p:dialog id="settingsDialog" header="Settings" resizable="false"
modal="true" widgetVar="settingsDialog">
<h:form>
<h:panelGrid columns="2" cellpadding="10">
<h:outputText value="Look and Feel:" />
<p:themeSwitcher value="#{currentThemeBean.theme}"
style="width:150px" effect="fade">
<f:selectItem itemLabel="Choose Theme" itemValue="" />
<f:selectItems value="#{themeSwitcherBean.themes}" />
</p:themeSwitcher>
</h:panelGrid>
<center>
<p:commandButton value="Ok" oncomplete="settingsDialog.hide();" />
</center>
</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