From 1a11d2cc962be11caabb004f9ec9956f31edb066 Mon Sep 17 00:00:00 2001 From: nie <nie@informatik.uni-kiel.de> Date: Fri, 23 Dec 2011 16:47:27 +0100 Subject: [PATCH] Started to replace project with MIProject and the other ecore-classed which are already existing; Added some beans and comments. --- Kieker.WebGUI/pom.xml | 15 +++++++++ .../java/kieker/beans/CurrentProjectBean.java | 20 +++++++++++ .../beans/CurrentSelectedPluginBean.java | 9 +++++ .../main/java/kieker/beans/ProjectsBean.java | 29 +++++++++------- .../src/main/java/kieker/common/Project.java | 33 ------------------- Kieker.WebGUI/src/main/webapp/main.xhtml | 27 +++++++++++---- 6 files changed, 83 insertions(+), 50 deletions(-) create mode 100644 Kieker.WebGUI/src/main/java/kieker/beans/CurrentProjectBean.java create mode 100644 Kieker.WebGUI/src/main/java/kieker/beans/CurrentSelectedPluginBean.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/common/Project.java diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index b0627321..89163cf7 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -31,6 +31,21 @@ <artifactId>jsf-impl</artifactId> <version>2.1.6</version> </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>org.eclipse.emf.common</artifactId> + <version>2.6.0.v20100614-1136</version> + </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>ecore-xmi</artifactId> + <version>2.2.3</version> + </dependency> + <dependency> + <groupId>org.eclipse.emf</groupId> + <artifactId>org.eclipse.emf.ecore</artifactId> + <version>2.6.0.v20100614-1136</version> + </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> diff --git a/Kieker.WebGUI/src/main/java/kieker/beans/CurrentProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/beans/CurrentProjectBean.java new file mode 100644 index 00000000..f6d46719 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/beans/CurrentProjectBean.java @@ -0,0 +1,20 @@ +package kieker.beans; + +import kieker.analysis.model.analysisMetaModel.MIProject; + +/** + * + * @author Nils Christian Ehmke + */ +public class CurrentProjectBean { + + private MIProject project; + + public MIProject getProject() { + return project; + } + + public void setProject(MIProject project) { + this.project = project; + } +} diff --git a/Kieker.WebGUI/src/main/java/kieker/beans/CurrentSelectedPluginBean.java b/Kieker.WebGUI/src/main/java/kieker/beans/CurrentSelectedPluginBean.java new file mode 100644 index 00000000..630ca5c2 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/beans/CurrentSelectedPluginBean.java @@ -0,0 +1,9 @@ +package kieker.beans; + +/** + * + * @author Nils Christian Ehmke + */ +public class CurrentSelectedPluginBean { + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/beans/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/beans/ProjectsBean.java index aa5bd030..9f18ed15 100644 --- a/Kieker.WebGUI/src/main/java/kieker/beans/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/beans/ProjectsBean.java @@ -1,10 +1,11 @@ package kieker.beans; -import kieker.common.Project; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ApplicationScoped; import javax.faces.bean.ManagedBean; +import kieker.analysis.model.analysisMetaModel.MIProject; +import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import org.primefaces.model.DefaultTreeNode; import org.primefaces.model.TreeNode; @@ -16,29 +17,35 @@ import org.primefaces.model.TreeNode; @ApplicationScoped public class ProjectsBean { - private final List<Project> projects; + private final List<MIProject> projects; + private final MAnalysisMetaModelFactory factory; public ProjectsBean() { - projects = new ArrayList<Project>(); + projects = new ArrayList<MIProject>(); + factory = new MAnalysisMetaModelFactory(); } public synchronized boolean addProject(final String projectName) { - return projects.add(new Project(projectName)); + final MIProject project = factory.createProject(); + + project.setName(projectName); + + return projects.add(project); } public synchronized TreeNode getProjectsRoot() { TreeNode root = new DefaultTreeNode("Root", null); - - for (final Project project : projects) { + + for (final MIProject 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); - } + + // for (final String dependency : project.getDependencies()) { + // final TreeNode dependencyNode = new DefaultTreeNode(dependency, dependenciesNode); + // } } - + return root; } } diff --git a/Kieker.WebGUI/src/main/java/kieker/common/Project.java b/Kieker.WebGUI/src/main/java/kieker/common/Project.java deleted file mode 100644 index 5779d506..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/common/Project.java +++ /dev/null @@ -1,33 +0,0 @@ -package kieker.common; - -import java.util.ArrayList; -import java.util.List; -import kieker.analysis.plugin.port.APlugin; - -/** - * - * @author Nils Christian Ehmke - */ -public class Project { - - private String name; - private List<String> dependencies; - - public Project(final String name) { - this.name = name; - this.dependencies = new ArrayList<String>(); - System.out.println(APlugin.class.getName()); - } - - public String getName() { - return name; - } - - public synchronized boolean addDependency(final String dependencyName) { - return this.dependencies.add(dependencyName); - } - - public synchronized List<String> getDependencies() { - return dependencies; - } -} diff --git a/Kieker.WebGUI/src/main/webapp/main.xhtml b/Kieker.WebGUI/src/main/webapp/main.xhtml index c11eb0e6..401fed6a 100644 --- a/Kieker.WebGUI/src/main/webapp/main.xhtml +++ b/Kieker.WebGUI/src/main/webapp/main.xhtml @@ -4,10 +4,12 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" > + <f:view contentType="text/html"> <h:head> <title>Kieker.WebGUI</title> + <!-- The following style modifications make sure that the menu bar is visible. --> <style type="text/css"> .ui-layout-north { z-index:20 !important; @@ -18,16 +20,18 @@ .ui-layout-north .ui-layout-unit-content { overflow:visible !important; } + </style> </h:head> <h:body> - + <!-- This is the layout for the whole page. --> <p:layout fullPage="true"> + <!-- This is the top unit within the layout and is used for the menu bar. --> <p:layoutUnit position="north" size="60" collapsible="false"> <h:form> - <p:menubar> + <p:menubar style="font-size: 15px"> <p:submenu label="Projects"> <p:menuitem value="New Project" action="#{projectsBean.addProject('NewProject')}" ajax="true" update="ProjectsList"/> <p:menuitem value="Save Project"/> @@ -36,15 +40,16 @@ </p:submenu> <p:submenu label="Help"> - <p:menuitem value="About..."/> + <p:menuitem value="About..." onclick="AboutDialog.show();"/> </p:submenu> </p:menubar> </h:form> </p:layoutUnit> + <!-- The following layout is at the left side of the page and shows the available projects. --> <p:layoutUnit style="font-size:15px" header="Projects" collapsible="true" position="west" size="200" resizable="true" minSize="100"> <h:form id="ProjectsList"> - <p:tree selectionMode="single" value="#{projectsBean.projectsRoot}" var="node" > + <p:tree selectionMode="single" style="width: auto" value="#{projectsBean.projectsRoot}" var="node" > <p:treeNode> <h:outputText value="#{node}"/> </p:treeNode> @@ -52,10 +57,12 @@ </h:form> </p:layoutUnit> + <!-- The following layout unit is within the center and used for the graph. --> <p:layoutUnit position="center"> </p:layoutUnit> + <!-- The following layout unit is located at the bottom and will be used for properties. --> <p:layoutUnit style="font-size:15px" position="south" size="150" header="Properties" resizable="true" collapsible="true"> <p:dataTable id="carList"> @@ -89,9 +96,10 @@ </p:dataTable> </p:layoutUnit> + <!-- The following layout unit is located at the right side of the page and is used as a tool palette. It shows the available plugins etc. --> <p:layoutUnit style="font-size:15px" position="east" size="200" header="Tool Palette" resizable="true" collapsible="true"> - <p:tree value="#{availablePluginsBean.availablePluginsRoot}" var="node" > - <p:treeNode> + <p:tree style="width: auto" value="#{availablePluginsBean.availablePluginsRoot}" var="node" > + <p:treeNode > <h:outputText value="#{node}"/> </p:treeNode> </p:tree> @@ -99,6 +107,13 @@ </p:layout> </h:body> + + <!-- This is the about-dialog. --> + <p:dialog header="About..." resizable="false" modal="true" style="font-size: 15px;width: auto" widgetVar="AboutDialog"> + <h:outputText value="Kieker.WebGUI"/><br/><br/> + <h:outputText value="Version: 1.0-SNAPSHOT"/><br/> + <h:outputText value="Copyright (c) 2011 Kieker Project"/> + </p:dialog> </f:view> </html> -- GitLab