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

Some bug fixing

parent 57ca8cf6
No related branches found
No related tags found
No related merge requests found
......@@ -186,8 +186,19 @@ public final class CurrentAnalysisEditorBean {
public void setProjectName(final String newName) {
synchronized (this) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(newName);
this.projectName = newName;
}
}
/**
* This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by
* JSF.</b>
*/
public void initalize() {
synchronized (this) {
// Make sure that the initialization will only be done for the init request.
if (!FacesContext.getCurrentInstance().isPostback()) {
this.project = ProjectsBean.getInstance().openProject(this.projectName);
this.getConnectionsFromProject();
if (this.project != null) {
......@@ -204,6 +215,7 @@ public final class CurrentAnalysisEditorBean {
}
}
}
}
/**
* Assembles and returns the available components as a primefaces tree. Keep in mind that the tree is currently assembled every time this method is called.
......
......@@ -22,6 +22,7 @@ package kieker.webgui.beans.view;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import kieker.analysis.display.AbstractDisplay;
import kieker.analysis.display.HtmlText;
......@@ -86,11 +87,24 @@ public class CurrentCockpitBean {
public void setProjectName(final String newName) {
synchronized (this) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(newName);
this.projectName = newName;
}
}
/**
* This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by
* JSF.</b>
*/
public void initalize() {
synchronized (this) {
// Make sure that the initialization will only be done for the init request.
if (!FacesContext.getCurrentInstance().isPostback()) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(this.projectName);
}
}
}
/**
* This method delivers the project name stored in this bean.
*
......
......@@ -95,6 +95,24 @@ public class CurrentCockpitEditorBean {
// No code necessary
}
/**
* This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by
* JSF.</b>
*/
public void initalize() {
synchronized (this) {
// Make sure that the initialization will only be done for the init request.
if (!FacesContext.getCurrentInstance().isPostback()) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(this.projectName);
if (this.project != null) {
// Remember the current time! This is important for the later comparison of the time stamps.
this.resetTimeStamp();
}
}
}
}
/**
* This method delivers the project stored in this bean.
*
......@@ -114,14 +132,7 @@ public class CurrentCockpitEditorBean {
*/
public void setProjectName(final String newName) {
synchronized (this) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(newName);
this.projectName = newName;
if (this.project != null) {
// Remember the current time! This is important for the later comparison of the time stamps.
this.resetTimeStamp();
}
}
}
......
......@@ -82,11 +82,24 @@ public class CurrentControllerBean {
public void setProjectName(final String newName) {
synchronized (this) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(newName);
this.projectName = newName;
}
}
/**
* This method initializes the bean by using the current project name to load the project. <b>Do not call this method manually. It will only be accessed by
* JSF.</b>
*/
public void initalize() {
synchronized (this) {
// Make sure that the initialization will only be done for the init request.
if (!FacesContext.getCurrentInstance().isPostback()) {
// Remember the given parameters
this.project = ProjectsBean.getInstance().openProject(this.projectName);
}
}
}
/**
* This method delivers the project stored in this bean.
*
......
<?xml version='1.0' encoding='UTF-8' ?>
<!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"
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:c="http://java.sun.com/jsp/jstl/core">
<f:metadata>
<f:viewParam name="projectName" value="#{currentAnalysisEditorBean.projectName}"/>
<f:viewParam id="projectNameParam" name="projectName" value="#{currentAnalysisEditorBean.projectName}"/>
<f:event type="preRenderView" listener="#{currentAnalysisEditorBean.initalize()}" />
</f:metadata>
<h:head>
......
......@@ -9,6 +9,7 @@
<f:metadata>
<f:viewParam name="projectName" value="#{currentCockpitBean.projectName}"/>
<f:event type="preRenderView" listener="#{currentCockpitBean.initalize()}" />
</f:metadata>
<h:head>
......
......@@ -9,6 +9,7 @@
<f:metadata>
<f:viewParam name="projectName" value="#{currentCockpitEditorBean.projectName}"/>
<f:event type="preRenderView" listener="#{currentCockpitEditorBean.initalize()}" />
</f:metadata>
<h:head>
......@@ -48,7 +49,7 @@
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-document" value=" New View" onclick="newViewDialog.show()" ajax="true"/>
<p:separator/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project" update=":messages" ajax="true" action="#{currentCockpitEditorBean.saveProject(false)}" disabled="#{empty currentCockpitEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{empty currentAnalysisEditorBean.project}"/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-disk" value=" Save Project As" update=":messages" ajax="true" disabled="#{empty currentCockpitEditorBean.project}"/>
<p:separator/>
<p:menuitem styleClass="element-with-whitespace" icon="ui-icon-refresh" value=" Reload Project" ajax="true" disabled="#{empty currentCockpitEditorBean.project or true}"/>
<p:separator/>
......
......@@ -9,6 +9,7 @@
<f:metadata>
<f:viewParam name="projectName" value="#{currentControllerBean.projectName}"/>
<f:event type="preRenderView" listener="#{currentControllerBean.initalize()}" />
</f:metadata>
<h:head>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment