Quitada librería con tema bootstrap.

Añadida libería con todos los temas para primefaces 7.
Añadido selector de tema en la pantalla home.
This commit is contained in:
mgarcianun
2019-11-28 18:20:01 +01:00
parent b5c49a6776
commit 8fcc5d7697
11 changed files with 143 additions and 49 deletions

View File

@@ -4,6 +4,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/WildFly 14.0 Runtime"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/primefaces-7.0.jar"/> <classpathentry kind="lib" path="docroot/WEB-INF/lib/primefaces-7.0.jar"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/bootstrap-1.0.10.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@@ -25,7 +25,7 @@
</context-param> </context-param>
<context-param> <context-param>
<param-name>primefaces.THEME</param-name> <param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value> <param-value>aristo</param-value>
</context-param> </context-param>
<!-- JSF mapping --> <!-- JSF mapping -->
@@ -72,48 +72,4 @@
<welcome-file>home.xhtml</welcome-file> <welcome-file>home.xhtml</welcome-file>
</welcome-file-list> </welcome-file-list>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/font-sfnt</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff2</extension>
<mime-type>application/font-woff2</mime-type>
</mime-mapping>
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>eot?#iefix</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg#latobold</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg#latoblack</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg#latolight</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg#latoregular</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg#fontawesomeregular</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
</web-app> </web-app>

View File

@@ -7,6 +7,7 @@
<h:head> <h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MyHealth Online Services</title> <title>MyHealth Online Services</title>
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces"/>
<h:outputStylesheet library="css" name="estilos.css" /> <h:outputStylesheet library="css" name="estilos.css" />
</h:head> </h:head>
<h:outputScript> <h:outputScript>

View File

@@ -11,6 +11,13 @@
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form>
<p:panel header="Pagina principal"> <p:panel header="Pagina principal">
<p:panelGrid>
<p:outputLabel for="basic" value="Cambio de tema" />
<p:themeSwitcher id="basic" style="width:165px">
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
</p:themeSwitcher>
</p:panelGrid>
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputLabel value="Fecha" /> <h:outputLabel value="Fecha" />
<p:calendar pattern="dd/MM/yyyy" /> <p:calendar pattern="dd/MM/yyyy" />
@@ -18,7 +25,7 @@
<p:editor /> <p:editor />
</h:panelGrid> </h:panelGrid>
<h:panelGroup> <h:panelGroup>
<h:panelGrid columns="2" > <h:panelGrid columns="2">
<h:outputLabel value="Logeado como:" /> <h:outputLabel value="Logeado como:" />
<p:inputText readonly="true" value="#{home.userName}" /> <p:inputText readonly="true" value="#{home.userName}" />
</h:panelGrid> </h:panelGrid>

View File

@@ -42,14 +42,14 @@
<p:outputLabel value="Especialidad médica:" for="medicalSpecialty" /> <p:outputLabel value="Especialidad médica:" for="medicalSpecialty" />
<p:selectOneMenu id="medicalSpecialty" value="#{registerUser.medicalSpecialty}" style="width:350px"> <p:selectOneMenu id="medicalSpecialty" value="#{registerUser.medicalSpecialty}" style="width:350px">
<f:selectItem itemLabel="Seleccione una especialidad médica..." itemValue="" noSelectionOption="true" /> <f:selectItem itemLabel="Seleccione una especialidad médica..." itemValue="" noSelectionOption="true" />
<f:selectItems value="#{registerUser.medicalSpecialties}" var="c" itemDescription="#{c.description}" itemValue="#{c.id}" /> <f:selectItems value="#{registerUser.medicalSpecialties}" var="c" itemDescription="#{c.description}" itemValue="#{c.name}" />
</p:selectOneMenu> </p:selectOneMenu>
<p:message for="medicalSpecialty" /> <p:message for="medicalSpecialty" />
<p:outputLabel value="Centro:" for="primaryHealthCareCenter" /> <p:outputLabel value="Centro:" for="primaryHealthCareCenter" />
<p:selectOneMenu id="primaryHealthCareCenter" value="#{registerUser.medicalSpecialty}" style="width:350px"> <p:selectOneMenu id="primaryHealthCareCenter" value="#{registerUser.medicalSpecialty}" style="width:350px">
<f:selectItem itemLabel="Seleccione una centro..." itemValue="" noSelectionOption="true" /> <f:selectItem itemLabel="Seleccione una centro..." itemValue="" noSelectionOption="true" />
<f:selectItems value="#{registerUser.medicalSpecialties}" var="c" itemDescription="#{c.description}" itemValue="#{c.id}" /> <f:selectItems value="#{registerUser.medicalSpecialties}" var="c" itemDescription="#{c.description}" itemValue="#{c.name}" />
</p:selectOneMenu> </p:selectOneMenu>
<p:message for="primaryHealthCareCenter" /> <p:message for="primaryHealthCareCenter" />

View File

@@ -0,0 +1,26 @@
package managedbean.common;
import java.io.Serializable;
import javax.annotation.ManagedBean;
import javax.enterprise.context.SessionScoped;
@ManagedBean
@SessionScoped
public class CurrentTheme implements Serializable {
private Theme currentTheme;
public CurrentTheme() {
}
public Theme getCurrentTheme() {
return currentTheme;
}
public void setCurrentTheme(Theme currentTheme) {
this.currentTheme = currentTheme;
}
}

View File

@@ -0,0 +1,46 @@
package managedbean.common;
public class Theme {
private int id;
private String displayName;
private String name;
public Theme() {
}
public Theme(int id, String displayName, String name) {
this.id = id;
this.displayName = displayName;
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return name;
}
}

View File

@@ -0,0 +1,53 @@
package managedbean.common;
import java.util.ArrayList;
import java.util.List;
public class ThemeService {
/**
*
*/
private static final long serialVersionUID = 1L;
public static final String DEFAULT_THEME = "aristo";
public static final List<Theme> THEMES = new ArrayList<Theme>() {
{
add(new Theme(1, "afterdark", "afterdark"));
add(new Theme(2, "afternoon", "afternoon"));
add(new Theme(3, "afterwork", "afterwork"));
add(new Theme(4, "black-tie", "black-tie"));
add(new Theme(5, "blitzer", "blitzer"));
add(new Theme(6, "bluesky", "bluesky"));
add(new Theme(7, "bootstrap", "bootstrap"));
add(new Theme(8, "casablanca", "casablanca"));
add(new Theme(9, "cruze", "cruze"));
add(new Theme(10, "cupertino", "cupertino"));
add(new Theme(11, "dark-hive", "dark-hive"));
add(new Theme(12, "dot-luv", "dot-luv"));
add(new Theme(13, "eggplant", "eggplant"));
add(new Theme(14, "excite-bike", "excite-bike"));
add(new Theme(15, "flick", "flick"));
add(new Theme(16, "glass-x", "glass-x"));
add(new Theme(17, "home", "home"));
add(new Theme(18, "hot-sneaks", "hot-sneaks"));
add(new Theme(19, "humanity", "humanity"));
add(new Theme(20, "le-frog", "le-frog"));
add(new Theme(21, "midnight", "midnight"));
add(new Theme(22, "mint-choc", "mint-choc"));
add(new Theme(23, "overcast", "overcast"));
add(new Theme(24, "pepper-grinder", "pepper-grinder"));
add(new Theme(25, "redmond", "redmond"));
add(new Theme(26, "rocket", "rocket"));
add(new Theme(27, "sam", "sam"));
add(new Theme(28, "smoothness", "smoothness"));
add(new Theme(29, "south-street", "south-street"));
add(new Theme(30, "start", "start"));
add(new Theme(31, "sunny", "sunny"));
add(new Theme(32, "swanky-purse", "swanky-purse"));
add(new Theme(33, "trontastic", "trontastic"));
add(new Theme(34, "ui-darkness", "ui-darkness"));
add(new Theme(35, "ui-lightness", "ui-lightness"));
add(new Theme(36, "vader", "vader"));
}
};
}

View File

@@ -1,9 +1,11 @@
package managedbean.common; package managedbean.common;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
/*** /***
@@ -23,6 +25,10 @@ public class homeMBean implements Serializable {
isLogedIn = SessionUtils.isLogedIn(); isLogedIn = SessionUtils.isLogedIn();
} }
public List<Theme> getThemes() {
return ThemeService.THEMES;
}
public boolean isLogedIn() { public boolean isLogedIn() {
return this.isLogedIn; return this.isLogedIn;
} }