diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java index cf246f534e4f9e1a584fb5286986d3162d9556c7..76c6776181afb5e65efcc4399a8607bdc0cb7cdc 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java @@ -16,7 +16,6 @@ package kieker.webgui.beans.session; -import java.util.Locale; import java.util.Map; import javax.annotation.PostConstruct; @@ -40,7 +39,6 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; @SessionScoped public final class CurrentConfigurationBean { - private String locale; private String lookAndFeel; private String gridColor; private int gridSize; @@ -160,26 +158,6 @@ public final class CurrentConfigurationBean { } } - public void setLocale(final String locale) { - synchronized (this) { - this.locale = locale; - CurrentConfigurationBean.saveValueInCookie(this.globalPropertiesBean.getLanguageCookieName(), locale); - - } - } - - public String getLocale() { - synchronized (this) { - return this.locale; - } - } - - public Locale getLocaleObject() { - synchronized (this) { - return new Locale(this.locale); - } - } - /** * This method tries to load the default values of the properties from the {@link GlobalPropertiesBean} and the faces context. */ @@ -197,8 +175,6 @@ public final class CurrentConfigurationBean { this.gridColor = this.globalPropertiesBean.getAnalysisEditorDefaultGridColor(); this.gridSize = Integer.parseInt(this.globalPropertiesBean.getAnalysisEditorDefaultGridSize()); - - this.locale = "en"; } } @@ -220,9 +196,6 @@ public final class CurrentConfigurationBean { if (cookies.containsKey(this.globalPropertiesBean.getAnalysisEditorGridSizeCookieName())) { this.gridSize = Integer.parseInt(((Cookie) cookies.get(this.globalPropertiesBean.getAnalysisEditorGridSizeCookieName())).getValue()); } - if (cookies.containsKey(this.globalPropertiesBean.getLanguageCookieName())) { - this.locale = ((Cookie) cookies.get(this.globalPropertiesBean.getLanguageCookieName())).getValue(); - } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index 02e4db07d72662700996b8ad4d340737cefd2107..8141f45204a3b6f694232f59a15c6c9d34e1a3ca 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -19,6 +19,7 @@ package kieker.webgui.beans.session; import javax.faces.bean.ManagedBean; import javax.faces.bean.ManagedProperty; import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; import kieker.webgui.beans.application.GlobalPropertiesBean; @@ -43,9 +44,6 @@ public final class UserBean { @ManagedProperty(value = "#{globalPropertiesBean}") private GlobalPropertiesBean globalPropertiesBean; - @ManagedProperty(value = "#{currentConfigurationBean}") - private CurrentConfigurationBean currentConfigurationBean; - /** * Default constructor. <b>Do not use this constructor. This bean is JSF managed.</b> */ @@ -112,22 +110,14 @@ public final class UserBean { this.globalPropertiesBean = globalPropertiesBean; } - public CurrentConfigurationBean getCurrentConfigurationBean() { - return this.currentConfigurationBean; - } - - public void setCurrentConfigurationBean(final CurrentConfigurationBean currentConfigurationBean) { - this.currentConfigurationBean = currentConfigurationBean; - } - /** * This method shows the welcome message using the growl component and the global properties. */ public void showWelcomeMessage() { if (this.globalPropertiesBean != null) { final String finalMsg = String.format(UserBean.WELCOME_MSG_TEMPLATE, - this.globalPropertiesBean.getShortWelcomeMessage(this.currentConfigurationBean.getLocaleObject()), - this.globalPropertiesBean.getWelcomeMessage(this.currentConfigurationBean.getLocaleObject())); + this.globalPropertiesBean.getShortWelcomeMessage(FacesContext.getCurrentInstance().getELContext().getLocale()), + this.globalPropertiesBean.getWelcomeMessage(FacesContext.getCurrentInstance().getELContext().getLocale())); RequestContext.getCurrentInstance().execute(finalMsg); } diff --git a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml index 97f2240b8d9c22c1a4624ee3cc85464d92da6eed..cc3978dd49a48e6aa0c0fee62b755c8343269403 100644 --- a/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml +++ b/Kieker.WebGUI/src/main/webapp/AnalysisEditor.xhtml @@ -13,7 +13,7 @@ <f:event type="preRenderView" listener="#{currentAnalysisEditorBean.initialize()}" /> </f:metadata> - <f:view locale="#{currentConfigurationBean.locale}"> + <f:view> <h:head> <title>Kieker.WebGUI</title> <!-- Load the necessary CSS files. --> diff --git a/Kieker.WebGUI/src/main/webapp/Controller.xhtml b/Kieker.WebGUI/src/main/webapp/Controller.xhtml index e0039b07b1f809c0a593c8a87eb5563a85b4753b..bff0f0b0c1e31fbf338fd35b26438f7cd395bd8e 100644 --- a/Kieker.WebGUI/src/main/webapp/Controller.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Controller.xhtml @@ -11,7 +11,7 @@ <f:viewParam name="projectName" value="#{currentControllerBean.projectName}"/> </f:metadata> - <f:view locale="#{currentConfigurationBean.locale}"> + <f:view> <h:head> <title>Kieker.WebGUI</title> <link rel="stylesheet" type="text/css" href="../css/Common.css" /> diff --git a/Kieker.WebGUI/src/main/webapp/Login.xhtml b/Kieker.WebGUI/src/main/webapp/Login.xhtml index 0f86c8d37aacbf54bda0591c9e300d0847e76fb5..567d2d51dce9f9580f12d42e5ca090551ff543ce 100644 --- a/Kieker.WebGUI/src/main/webapp/Login.xhtml +++ b/Kieker.WebGUI/src/main/webapp/Login.xhtml @@ -5,7 +5,7 @@ xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> - <f:view locale="#{currentConfigurationBean.locale}"> + <f:view> <h:head> <title>Kieker.WebGUI</title> <link rel="stylesheet" type="text/css" href="../css/Common.css" /> diff --git a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml index 917acbe54a46874ba2de0e1d5f61f3129ae4e7f2..7bfc480fb6542732b654a310f693d7a971d2ebc6 100644 --- a/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml +++ b/Kieker.WebGUI/src/main/webapp/ProjectOverview.xhtml @@ -6,7 +6,7 @@ xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> - <f:view locale="#{currentConfigurationBean.locale}"> + <f:view> <h:head> <title>Kieker.WebGUI</title> <link rel="stylesheet" type="text/css" href="../css/Common.css" /> diff --git a/Kieker.WebGUI/src/main/webapp/css/Common.css b/Kieker.WebGUI/src/main/webapp/css/Common.css index da4370917745265eab8d078738222aa55e191adc..614fbdd58c2fe77e50164de3338b9582da2599f7 100644 --- a/Kieker.WebGUI/src/main/webapp/css/Common.css +++ b/Kieker.WebGUI/src/main/webapp/css/Common.css @@ -241,4 +241,12 @@ background: url('../img/icons/ManageLibraries.png') no-repeat !important; height:16px; width:16px; +} + +.rightAlignedColumn { + text-align: right !important; +} + +.normalColumn { + } \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml index 114993ea39d3843eabc5d7b9aeb5744bec693d12..addc177d82b07abfe4026908409fcef308d571fa 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/settingsDialog.xhtml @@ -10,7 +10,7 @@ <h:form> <p:tabView> <p:tab title="#{localizedMessages.common}"> - <h:panelGrid columns="2" cellpadding="10"> + <h:panelGrid columns="2" cellpadding="10" columnClasses="rightAlignedColumn, normalColumn"> <h:outputText value="#{localizedMessages.lookAndFeel}:" /> <p:themeSwitcher value="#{currentConfigurationBean.lookAndFeel}" style="width:150px" effect="fade"> <f:selectItem itemLabel="#{localizedMessages.chooseTheme}" itemValue="" /> @@ -18,24 +18,24 @@ </p:themeSwitcher> <h:outputText value="#{localizedMessages.language}:"/> - <p:selectOneMenu value="#{currentConfigurationBean.locale}" style="width:150px"> + <p:selectOneMenu value="#{facesContext.ELContext.locale.toString()}" style="width:150px" disabled="true"> <f:selectItem itemValue="en" itemLabel="English"/> <f:selectItem itemValue="de" itemLabel="Deutsch"/> </p:selectOneMenu> </h:panelGrid> </p:tab> <p:tab title="#{localizedMessages.analysisEditor}"> - <h:panelGrid columns="2" cellpadding="10"> + <h:panelGrid columns="2" cellpadding="10" columnClasses="rightAlignedColumn, normalColumn"> <h:outputText value="#{localizedMessages.toolPalette}:"/> - <p:selectOneMenu style="width:150px"> + <p:selectOneMenu style="width: 100%"> <f:selectItem itemLabel="#{localizedMessages.lists}"/> </p:selectOneMenu> <h:outputText value="#{localizedMessages.gridSize}:"/> - <p:spinner value="#{currentConfigurationBean.gridSize}" valueChangeListener="#{currentAnalysisEditorBean.gridSizeListener}" suffix=" [px]"/> + <p:spinner style="width: 100%" value="#{currentConfigurationBean.gridSize}" valueChangeListener="#{currentAnalysisEditorBean.gridSizeListener}" suffix=" [px]"/> <h:outputText value="#{localizedMessages.gridColor}:"/> - <p:colorPicker value="#{currentConfigurationBean.gridColor}" valueChangeListener="#{currentAnalysisEditorBean.gridColorListener}"/> + <p:colorPicker style="width: 100%" value="#{currentConfigurationBean.gridColor}" valueChangeListener="#{currentAnalysisEditorBean.gridColorListener}"/> </h:panelGrid> </p:tab> <p:tab title="#{localizedMessages.analysisController}" disabled="true">