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

Started with the necessary beans for the tool.

parent 6e497942
No related branches found
No related tags found
No related merge requests found
package beans;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;
/**
*
* @author Nils Christian Ehmke
*/
@ManagedBean
@SessionScoped
public class AvailablePluginsBean {
public synchronized TreeNode getAvailablePluginsRoot() {
TreeNode root = new DefaultTreeNode("Root", null);
final TreeNode readedNode = new DefaultTreeNode("Reader", root);
final TreeNode analysisPluginsNode = new DefaultTreeNode("AnalysisPlugins", root);
return root;
}
}
package beans;
import common.Project;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;
/**
*
* @author Nils Christian Ehmke
*/
@ManagedBean
@ApplicationScoped
public final class ProjectsBean {
private final List<Project> projects;
public ProjectsBean() {
projects = new ArrayList<Project>();
}
public synchronized boolean addProject(final String projectName) {
return projects.add(new Project(projectName));
}
public synchronized TreeNode getProjectsRoot() {
TreeNode root = new DefaultTreeNode("Root", null);
for (final Project project : projects) {
final TreeNode projectNode = new DefaultTreeNode(project.getName(), root);
final TreeNode dependenciesNode = new DefaultTreeNode("Dependencies", projectNode);
final TreeNode usedPluginsNode = new DefaultTreeNode("Used Plugins", projectNode);
for (final String dependency : project.getDependencies()) {
final TreeNode dependencyNode = new DefaultTreeNode(dependency, dependenciesNode);
}
}
return root;
}
}
package common;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Nils Christian Ehmke
*/
public final class Project {
private String name;
private List<String> dependencies;
public Project(final String name) {
this.name = name;
this.dependencies = new ArrayList<String>();
}
public String getName() {
return name;
}
public synchronized boolean addDependency(final String dependencyName) {
return this.dependencies.add(dependencyName);
}
public synchronized List<String> getDependencies() {
return dependencies;
}
}
...@@ -7,13 +7,17 @@ ...@@ -7,13 +7,17 @@
<title>Kieker.WebGUI</title> <title>Kieker.WebGUI</title>
</h:head> </h:head>
<h:body> <h:body>
<h:form> <h:form>
<p:layout fullPage="true"> <p:layout fullPage="true">
<p:layoutUnit position="top" height="115" collapsible="true"> <p:layoutUnit header="Current Project: n/a" position="top" height="115" collapsible="true">
<div style="padding-top:10px" align="center"> <div style="padding-top:10px" align="center">
<p:button value="New Project"/> <p:spacer width="60" height="10" />
<p:button value="New Project" onmousedown="#{projectsBean.addProject('Some Project')}" />
<p:spacer width="35" height="10" />
<p:button value="Add Dependency"/>
<p:spacer width="35" height="10" />
<p:button value="Remove Dependency"/>
<p:spacer width="35" height="10" /> <p:spacer width="35" height="10" />
<p:button value="Save Project"/> <p:button value="Save Project"/>
<p:spacer width="35" height="10" /> <p:spacer width="35" height="10" />
...@@ -22,8 +26,8 @@ ...@@ -22,8 +26,8 @@
</p:layoutUnit> </p:layoutUnit>
<p:layoutUnit header="Projects" collapsible="true" scrollable="true" position="left" width="200" resizable="true" minWidth="100"> <p:layoutUnit header="Projects" collapsible="true" scrollable="true" position="left" width="200" resizable="true" minWidth="100">
<p:tree value="#{treeBean.root}" var="node" expanded="true" > <p:tree style="font-size:15px" value="#{projectsBean.projectsRoot}" var="node" expanded="true" >
<p:treeNode> <p:treeNode>
<h:outputText value="#{node}"/> <h:outputText value="#{node}"/>
</p:treeNode> </p:treeNode>
...@@ -36,7 +40,7 @@ ...@@ -36,7 +40,7 @@
</p:panel> </p:panel>
<p:draggable for="handlepnl" handle=".ui-panel-titlebar" grid="40,40"/> <p:draggable for="handlepnl" handle=".ui-panel-titlebar" grid="40,40"/>
<p:resizable for="handlepnl" grid="40" /> <p:resizable for="handlepnl" grid="40" />
<p:panel style="font-size:15px;width:350px" id="handlepn2" header="ResourceUtilizationPlugin"> <p:panel style="font-size:15px;width:350px" id="handlepn2" header="ResourceUtilizationPlugin">
<h:outputText value="CPU-Utilization" /> <h:outputText value="CPU-Utilization" />
</p:panel> </p:panel>
...@@ -66,10 +70,14 @@ ...@@ -66,10 +70,14 @@
</p:panel> </p:panel>
<p:draggable for="handlepn6" handle=".ui-panel-titlebar" grid="40,40"/> <p:draggable for="handlepn6" handle=".ui-panel-titlebar" grid="40,40"/>
<p:resizable for="handlepn6" grid="40"/> <p:resizable for="handlepn6" grid="40"/>
</p:layoutUnit>
<p:layoutUnit position="bottom" height="150" scrollable="true" header="Properties" resizable="true" collapsible="true">
</p:layoutUnit> </p:layoutUnit>
<p:layoutUnit position="right" width="200" scrollable="true" header="Tool Palette" resizable="true" collapsible="true"> <p:layoutUnit position="right" width="200" scrollable="true" header="Tool Palette" resizable="true" collapsible="true">
<p:tree value="#{componentBean.root}" var="node" expanded="true" > <p:tree style="font-size:15px" value="#{availablePluginsBean.availablePluginsRoot}" var="node" expanded="true" >
<p:treeNode> <p:treeNode>
<h:outputText value="#{node}"/> <h:outputText value="#{node}"/>
</p:treeNode> </p:treeNode>
......
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