Jepsar PrimeFaces Theme

PrimeFaces theme and FontAwesome patch for standard PrimeFaces themes

License

License

Categories

Categories

PrimeFaces Jakarta EE The Web Tier Jakarta Server Faces
GroupId

GroupId

com.github.jepsar
ArtifactId

ArtifactId

primefaces-theme-jepsar
Last Version

Last Version

0.9.1
Release Date

Release Date

Type

Type

jar
Description

Description

Jepsar PrimeFaces Theme
PrimeFaces theme and FontAwesome patch for standard PrimeFaces themes
Project URL

Project URL

https://github.com/jepsar/Jepsar-PrimeFaces-Theme
Source Code Management

Source Code Management

https://github.com/jepsar/Jepsar-PrimeFaces-Theme

Download primefaces-theme-jepsar

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jepsar/primefaces-theme-jepsar/ -->
<dependency>
    <groupId>com.github.jepsar</groupId>
    <artifactId>primefaces-theme-jepsar</artifactId>
    <version>0.9.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jepsar/primefaces-theme-jepsar/
implementation 'com.github.jepsar:primefaces-theme-jepsar:0.9.1'
// https://jarcasting.com/artifacts/com.github.jepsar/primefaces-theme-jepsar/
implementation ("com.github.jepsar:primefaces-theme-jepsar:0.9.1")
'com.github.jepsar:primefaces-theme-jepsar:jar:0.9.1'
<dependency org="com.github.jepsar" name="primefaces-theme-jepsar" rev="0.9.1">
  <artifact name="primefaces-theme-jepsar" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jepsar', module='primefaces-theme-jepsar', version='0.9.1')
)
libraryDependencies += "com.github.jepsar" % "primefaces-theme-jepsar" % "0.9.1"
[com.github.jepsar/primefaces-theme-jepsar "0.9.1"]

Dependencies

provided (1)

Group / Artifact Type Version
javax : javaee-web-api jar 7.0

Project Modules

There are no modules declared in this project.

Jepsar PrimeFaces Theme

Note: PrimeFaces 7 resolved the issues that made me create this project. If you are using PF 7 don't bother to use this.

Usage

Make sure you've set the FontAwesome context parameter in the web.xml:

<context-param>
	<param-name>primefaces.FONT_AWESOME</param-name>
	<param-value>true</param-value>
</context-param>

Add this dependency to your pom.xml:

<dependency>
	<groupId>com.github.jepsar</groupId>
	<artifactId>primefaces-theme-jepsar</artifactId>
	<version>0.9.1</version>
</dependency>

FontAwesomeResourceHandler

This resource handler will strip the jQuery UI icons from the community PrimeFaces themes and adds FontAwesome rules to the theme. You can use it on existing applications without needing to convert all XHTML (for example ui-icon-gear to fa fa-cog). The injected CSS will take care of that.

Then, in the faces-config.xml, add the handler:

<application>
	<resource-handler>org.jepsar.primefaces.theme.jepsar.FontAwesomeResourceHandler</resource-handler>
</application>

You're done. But wait, maybe you need some custom styling? You can append a custom CSS resource by adding a context parameter in the web.xml:

<context-param>
	<param-name>org.jepsar.primefaces.theme.APPEND_CSS_RESOURCE</param-name>
	<param-value>custom.css</param-value>
</context-param>

NoThemeResourceHandler

If you want to replace the PrimeFaces theme with your own CSS, but don't want to build a theme JAR you can use this resource handler in combination with the custom CSS resource context parameter. I've found this handler to be useful when developing a theme.

Add the handler in the faces-config.xml:

<application>
	<resource-handler>org.jepsar.primefaces.theme.jepsar.NoThemeResourceHandler</resource-handler>
</application>

And the context parameter in the web.xml:

<context-param>
	<param-name>org.jepsar.primefaces.theme.APPEND_CSS_RESOURCE</param-name>
	<param-value>custom.css</param-value>
</context-param>

Theme

The theme is still work in progress. At this moment it is not ready to share yet, but it will come soon.

Icon mapping only

If you only want to use the jQuery UI to FontAwesome icon mapping:

<h:outputStylesheet name="/primefaces-jepsar/iconmapping.css"/>

Versions

Version
0.9.1