diff --git a/.gitignore b/.gitignore
index 99ee68e0..d6e2c19d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,5 @@ download.xhtml
nbactions.xml
faces-config.NavData
nb-configuration.xml
+.idea/
+BootsFacesWeb.iml
diff --git a/build.gradle b/build.gradle
index 38aa5418..0fd8055d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,8 +3,8 @@ apply plugin: 'war'
//webAppDirName = 'web'
-sourceCompatibility = '1.7'
-targetCompatibility = '1.7'
+sourceCompatibility = '1.8'
+targetCompatibility = '1.8'
repositories {
mavenLocal()
@@ -39,7 +39,7 @@ compile files("${System.properties['java.home']}/../lib/tools.jar")
compile fileTree(dir: 'bsflib', include: '*.jar') //Required for messages/utils
-compile "net.bootsfaces:bootsfaces:1.1.2-SNAPSHOT"
+compile "net.bootsfaces:bootsfaces:1.2.0"
}
war.doFirst {
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index ed8ae40b..99340b4a 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 59395e84..45a4d68f 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Fri Apr 28 16:18:17 CEST 2017
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
+zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index 4453ccea..cccdd3d5 100755
--- a/gradlew
+++ b/gradlew
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
-warn ( ) {
+warn () {
echo "$*"
}
-die ( ) {
+die () {
echo
echo "$*"
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
fi
# Escape application args
-save ( ) {
+save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
diff --git a/pom.xml b/pom.xml
index 61734ed1..0b919bf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
net.bootsfaces
BootsFacesWeb
- 1.1.2-SNAPSHOT
+ 1.2.1-SNAPSHOT
BootsFacesWeb
war
Documentation page of BootsFaces
@@ -75,7 +75,7 @@
net.bootsfaces
bootsfaces
- 1.1.2-SNAPSHOT
+ 1.2.1-SNAPSHOT
org.primefaces
diff --git a/src/main/java/Admin.java b/src/main/java/Admin.java
new file mode 100644
index 00000000..d7ce04bf
--- /dev/null
+++ b/src/main/java/Admin.java
@@ -0,0 +1,28 @@
+import java.util.Arrays;
+import java.util.List;
+
+public class Admin {
+ private String id;
+
+ private List skills = Arrays.asList(new AdminSkill("sleep"), new AdminSkill("work"), new AdminSkill("drink coffee"));
+
+ public Admin(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public List getSkills() {
+ return skills;
+ }
+
+ public void setSkills(List skills) {
+ this.skills = skills;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/AdminController.java b/src/main/java/AdminController.java
new file mode 100644
index 00000000..e27f118b
--- /dev/null
+++ b/src/main/java/AdminController.java
@@ -0,0 +1,44 @@
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class AdminController implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private List admins = new ArrayList<>();
+
+ private Admin selectedAdmin = null;
+
+ public AdminController() {
+ admins.add(new Admin("Hugo"));
+ admins.add(new Admin("Erwin"));
+ admins.add(new Admin("Helga"));
+ }
+
+ public List getAdmins() {
+ return admins;
+ }
+
+ public void setAdmins(List admins) {
+ this.admins = admins;
+ }
+
+ public void onSelect(Admin admin) {
+ this.selectedAdmin = admin;
+ }
+
+ public List getAdminSkills() {
+ if (null == selectedAdmin) {
+ return new ArrayList<>();
+ }
+ return selectedAdmin.getSkills();
+ }
+
+}
+
+
diff --git a/src/main/java/AdminSkill.java b/src/main/java/AdminSkill.java
new file mode 100644
index 00000000..b5106cd2
--- /dev/null
+++ b/src/main/java/AdminSkill.java
@@ -0,0 +1,17 @@
+
+public class AdminSkill {
+ private String id;
+
+ public AdminSkill(String id) {
+ this.id = id;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+}
diff --git a/src/main/java/Collector.java b/src/main/java/Collector.java
new file mode 100644
index 00000000..e3a106c9
--- /dev/null
+++ b/src/main/java/Collector.java
@@ -0,0 +1,146 @@
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Collector {
+
+ public static void main(String[] args) throws IOException {
+ scanFolder(new File("src/main/webapp"));
+ }
+
+ public static void scanFolder(File folder) throws IOException {
+ File[] files = folder.listFiles();
+ for (File file : files) {
+ if (file.isDirectory()) {
+ scanFolder(file);
+ } else if (file.getName().endsWith(".xhtml")) {
+ if (!file.getName().endsWith("Attributes.xhtml")) {
+ String newFile = readFile(file.getAbsolutePath());
+ if (newFile != null) {
+ writeFile(file.getAbsolutePath(), newFile);
+ //System.exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ public static void writeFile(String filename, String content) throws IOException {
+ new File(filename).delete();
+ try (FileWriter fw = new FileWriter(filename); BufferedWriter bw = new BufferedWriter(fw)) {
+ bw.write(content);
+ }
+ }
+
+ public static String readFile(String filename) {
+ Map chapters = new HashMap<>();
+ List tags = new ArrayList<>();
+ StringBuilder result = new StringBuilder();
+ String previousLine = "";
+
+ try (FileReader fr = new FileReader(filename); BufferedReader br = new BufferedReader(fr)) {
+ String line;
+
+ while ((line = br.readLine()) != null) {
+ if (line.contains("")) {
+ return null;
+ }
+ while (line.contains(""))) {
+ line = line.trim() + br.readLine().trim();
+ }
+ line = examineLine(filename, chapters, tags, previousLine, line, "");
+ line = examineLine(filename, chapters, tags, previousLine, line, "");
+ line = examineLine(filename, chapters, tags, previousLine, line, "");
+ result.append(line);
+ result.append('\n');
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (tags.size() > 1) {
+ int pos = result.indexOf("");
+ if (pos < 0) {
+ return null;
+ }
+ if (pos > 0) {
+ pos = result.lastIndexOf("\n", pos);
+ }
+ String start = result.substring(0, pos);
+ String end = result.substring(pos);
+ StringBuilder navigator = new StringBuilder();
+ navigator.append("\n\n\n");
+ navigator.append(" \n");
+ for (String tag : tags) {
+ navigator.append(" \n");
+ }
+
+ navigator.append(" \n");
+ navigator.append("\n\n");
+ System.out.println(filename + ": " + tags.size());
+ return start + navigator.toString() + end;
+
+ }
+ return null;
+ }
+
+ private static String examineLine(String filename, Map chapters, List tags,
+ String previousLine, String line, String headerTag) {
+ String newHeaderTag = "";
+ if (headerTag.equals("")) {
+ newHeaderTag = "";
+ }
+ if (line.contains(headerTag)) {
+ if (line.contains(" 0) {
+ innerText = innerText.replace("(Virtually no)", "");
+ int end2 = 0;
+ while (end2 < innerText.length() && (Character.isLetter(innerText.charAt(end2))
+ || Character.isWhitespace(innerText.charAt(end2)) || '&' == innerText.charAt(end2)
+ || '/' == innerText.charAt(end2) || ';' == innerText.charAt(end2)
+ || ':' == innerText.charAt(end2))) {
+ end2++;
+ }
+ String tag = innerText.substring(0, end2).replace("<", "").replace(">", "").replace(":", "_")
+ .replace("/", "").toLowerCase();
+ tag = tag.trim().replace(" ", "_");
+ if (tag.length() == 0) {
+ System.out.println("Empty tag?");
+ } else {
+ line = line.substring(0, line.indexOf(headerTag)) + newHeaderTag + "" + innerText
+ + "" + line.substring(end);
+ line = line.replace("" + headerTag.substring(1), "" + newHeaderTag.substring(1));
+ chapters.put(tag, innerText);
+ tags.add(tag);
+ newHeaderTag = "";
+ }
+ }
+ }
+ }
+ return line;
+ }
+}
diff --git a/src/main/java/Reindent.java b/src/main/java/Reindent.java
new file mode 100644
index 00000000..406df638
--- /dev/null
+++ b/src/main/java/Reindent.java
@@ -0,0 +1,262 @@
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+public class Reindent {
+ static int currentIndent = 0;
+ static int parameterIndent = 0;
+ static boolean insideTag = false;
+ static boolean modified = false;
+ static boolean insideStyle = false;
+ static boolean silent = false;
+
+ public static void main(String[] args) throws IOException {
+// readFile("src/main/webapp/layout/navbars.xhtml");
+ silent = true;
+ scanFolder(new File("src/main/webapp/"));
+ }
+
+ public static void scanFolder(File folder) throws IOException {
+ File[] files = folder.listFiles();
+ for (File file : files) {
+ if (file.isDirectory()) {
+ scanFolder(file);
+ } else if (file.getName().endsWith(".xhtml")) {
+ if (!file.getName().endsWith("Attributes.xhtml")) {
+ String newFile = readFile(file.getAbsolutePath());
+ if (newFile != null) {
+ writeFile(file.getAbsolutePath(), newFile);
+ System.out.println(file.getAbsolutePath());
+ // System.exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ public static void writeFile(String filename, String content) throws IOException {
+ new File(filename).delete();
+ try (FileWriter fw = new FileWriter(filename); BufferedWriter bw = new BufferedWriter(fw)) {
+ bw.write(content);
+ }
+ }
+
+ public static String readFile(String filename) {
+ if (filename.endsWith("DateTimePicker.xhtml")) {
+ return null;
+ }
+ if (filename.endsWith("InputText.xhtml")) {
+ return null;
+ }
+ if (filename.endsWith("InputSecret.xhtml")) {
+ return null;
+ }
+ StringBuilder result = new StringBuilder();
+
+ try (FileReader fr = new FileReader(filename); BufferedReader br = new BufferedReader(fr)) {
+ currentIndent = 0;
+ modified = false;
+ String line;
+
+ while ((line = br.readLine()) != null) {
+ line = examineLine(line);
+ result.append(line);
+ result.append('\n');
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (currentIndent == 0 && modified) {
+ return result.toString();
+ }
+ if (modified) {
+ System.out.println("Failed at " + filename + " Indent = " + currentIndent);
+ // System.exit(1);
+ }
+ return null;
+ }
+
+ private static String examineLine(String line) {
+ boolean startsWithClosingTag = false;
+ String originalLine = line;
+ line = line.trim();
+ if (line.startsWith("")) {
+ if (line.contains(" 1) {
+ insideTag = false;
+ }
+ if (line.contains("")) {
+ currentIndent--;
+ }
+ if (line.startsWith("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("")) {
+ currentIndent++;
+ }
+ if (line.contains("")))
+ // {
+ // currentIndent++;
+ // }
+ if (insideTag && (!line.startsWith("<"))) {
+ for (int i = 0; i < parameterIndent + 1; i++) {
+ line = " " + line;
+ }
+ } else {
+ for (int i = 0; i < currentIndent; i++) {
+ line = " " + line;
+ }
+ }
+ if (!silent)
+ System.out.println(currentIndent + line);
+ String[] open = line.split(
+ " 1) {
+ insideTag = true;
+ }
+ if (line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains("") && line.contains(""))) {
+ // currentIndent--;
+ // }
+ return line;
+ }
+}
diff --git a/src/main/java/de/beyondjava/jsf/sample/carshop/Car.java b/src/main/java/de/beyondjava/jsf/sample/carshop/Car.java
index 30521420..b3226610 100644
--- a/src/main/java/de/beyondjava/jsf/sample/carshop/Car.java
+++ b/src/main/java/de/beyondjava/jsf/sample/carshop/Car.java
@@ -18,7 +18,6 @@
import java.io.Serializable;
import java.util.Calendar;
-import java.util.Date;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@@ -137,6 +136,10 @@ public void setYear(int year) {
public int getEnginePower() {
return enginePower;
}
+
+ public int getEnginePowerKW() {
+ return (int)Math.round(enginePower / 1.35962);
+ }
public void setEnginePower(int enginePower) {
this.enginePower = enginePower;
@@ -158,4 +161,11 @@ public String getAge() {
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
return ((currentYear - year) * 12 +5) + " months";
}
+
+ @Override
+ public String toString() {
+ return "Car [brand=" + brand + ", color=" + color + ", type=" + type + ", year=" + year + ", mileage=" + mileage
+ + ", fuel=" + fuel + ", price=" + price + ", enginePower=" + enginePower + ", editable=" + editable
+ + "]";
+ }
}
diff --git a/src/main/java/de/beyondjava/jsf/sample/carshop/CarPool.java b/src/main/java/de/beyondjava/jsf/sample/carshop/CarPool.java
index 56f7de9a..c780cc86 100644
--- a/src/main/java/de/beyondjava/jsf/sample/carshop/CarPool.java
+++ b/src/main/java/de/beyondjava/jsf/sample/carshop/CarPool.java
@@ -25,7 +25,6 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
-import javax.faces.context.FacesContext;
@ManagedBean
@SessionScoped
@@ -110,8 +109,11 @@ private Car getRandomCar() {
int fuelIndex = (int) Math.floor(Math.random() * (staticOptions.getFuels().size() - 1));
String fuel = staticOptions.getFuels().get(fuelIndex + 1);
+
+ int enginePower = (int)Math.floor(Math.random() * 100) + 50;
Car c = new Car(brand, type, year, color, mileage, fuel, price);
+ c.setEnginePower(enginePower);
return c;
}
@@ -192,9 +194,19 @@ public void onSelect(Car car) {
public void onSelect(Car car, String typeOfSelection, String indexes) {
System.out.println("OnSelect:" + car + " typeOfSelection: " + typeOfSelection + " indexes: " + indexes);
+
+ if (!"row".equals(typeOfSelection)) {
+ car = null; // it's an empty instance of Car, so we better get rid of it
+ }
+ if (indexes!=null && indexes.contains("[")) {
+ car = null; // JSF can't deal with arrays of parameters
+ }
if (null != car) {
getCurrentlySelectedCars().add(car);
- } else if (null != indexes) {
+ } else if (null != indexes && "row".equals(typeOfSelection)) {
+ if (indexes.startsWith("[")) {
+ indexes = indexes.substring(1, indexes.length()-1);
+ }
String[] indexArray = indexes.split(",");
for (String index:indexArray) {
int i = Integer.valueOf(index);
@@ -208,9 +220,9 @@ public void onSelect(Car car, String typeOfSelection, String indexes) {
public void onDeselect(Car car, String typeOfSelection, String indexes) {
System.out.println("OnDeselect:" + car + " typeOfSelection: " + typeOfSelection + " indexes: " + indexes);
- if (null != car) {
+ if (null != car && "row".equals(typeOfSelection)) {
getCurrentlySelectedCars().remove(car);
- } else if (null != indexes) {
+ } else if (null != indexes && "row".equals(typeOfSelection)) {
String[] indexArray = indexes.split(",");
for (String index:indexArray) {
int i = Integer.valueOf(index);
@@ -218,6 +230,15 @@ public void onDeselect(Car car, String typeOfSelection, String indexes) {
}
}
}
+
+ public void onSelectDemo2(Car car, String typeOfSelection, String indexes) {
+ System.out.println("OnSelect:" + car + " typeOfSelection: " + typeOfSelection + " indexes: " + indexes);
+ }
+
+ public void onDeselectDemo2(Car car, String typeOfSelection, String indexes) {
+ System.out.println("OnDeselect:" + car + " typeOfSelection: " + typeOfSelection + " indexes: " + indexes);
+ }
+
public List getCurrentlySelectedCars() {
return currentlySelectedCars;
diff --git a/src/main/java/issue908/Cartaporte.java b/src/main/java/issue908/Cartaporte.java
new file mode 100644
index 00000000..69d511c3
--- /dev/null
+++ b/src/main/java/issue908/Cartaporte.java
@@ -0,0 +1,5 @@
+package issue908;
+
+public class Cartaporte {
+
+}
diff --git a/src/main/java/issue908/CartaportesController.java b/src/main/java/issue908/CartaportesController.java
new file mode 100644
index 00000000..a18edfd8
--- /dev/null
+++ b/src/main/java/issue908/CartaportesController.java
@@ -0,0 +1,81 @@
+package issue908;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class CartaportesController implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private boolean disabledToggle;
+ private Cartaporte selectedCartaporte;
+
+ private boolean disabled = true;
+
+ private Flete flete = null;
+
+ private Map fletesMap = new HashMap<>();
+
+ public CartaportesController() {
+ fletesMap.put("- Selecciona -", null);
+ fletesMap.put("Metal", new Flete(1, "Metal"));
+ fletesMap.put("Wood", new Flete(2, "Wood"));
+ fletesMap.put("Plastic", new Flete(3, "Plastic"));
+ }
+
+ public void populateMap() {
+ flete = fletesMap.get("Wood");
+ }
+
+
+ public String onView() {
+ return null;
+ }
+
+ public boolean getDisabledToggle() {
+ return this.disabledToggle;
+ }
+
+ public void setDisabledToggle(boolean disabledToggle) {
+ this.disabledToggle = disabledToggle;
+ }
+
+ public Cartaporte getSelectedCartaporte() {
+ return this.selectedCartaporte;
+ }
+
+ public void setSelectedCartaporte(Cartaporte selectedCartaporte) {
+ this.selectedCartaporte = selectedCartaporte;
+ }
+
+ public Map getFletesMap() {
+ return fletesMap;
+ }
+
+ public void setFletesMap(Map fletesMap) {
+ this.fletesMap = fletesMap;
+ }
+
+
+ public Flete getFlete() {
+ return flete;
+ }
+
+
+ public void setFlete(Flete flete) {
+ this.flete = flete;
+ }
+
+
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/issue908/CartaportesFletConv.java b/src/main/java/issue908/CartaportesFletConv.java
new file mode 100644
index 00000000..e9506228
--- /dev/null
+++ b/src/main/java/issue908/CartaportesFletConv.java
@@ -0,0 +1,27 @@
+package issue908;
+import java.io.Serializable;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+
+@FacesConverter(value = "cartaportesFletConv")
+public class CartaportesFletConv implements Converter, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ if (value == null) {
+ return null;
+ }
+
+ return (Flete) context.getApplication().evaluateExpressionGet(context, "#{cartaportesController}", CartaportesController.class)
+ .getFletesMap().get(value);
+ }
+
+ @Override
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ return (value instanceof Flete) ? ((Flete) value).getName() : "";
+ }
+}
diff --git a/src/main/java/issue908/Flete.java b/src/main/java/issue908/Flete.java
new file mode 100644
index 00000000..65736a4e
--- /dev/null
+++ b/src/main/java/issue908/Flete.java
@@ -0,0 +1,64 @@
+package issue908;
+import java.io.Serializable;
+import java.util.Date;
+
+public class Flete implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private int id;
+
+ private String name;
+
+ private double combustible;
+
+ private double viaticos;
+
+ private Date updated;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public double getCombustible() {
+ return combustible;
+ }
+
+ public void setCombustible(double combustible) {
+ this.combustible = combustible;
+ }
+
+ public double getViaticos() {
+ return viaticos;
+ }
+
+ public void setViaticos(double viaticos) {
+ this.viaticos = viaticos;
+ }
+
+ public Date getUpdated() {
+ return updated;
+ }
+
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ public Flete(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/issue908/FletesController.java b/src/main/java/issue908/FletesController.java
new file mode 100644
index 00000000..09b50bba
--- /dev/null
+++ b/src/main/java/issue908/FletesController.java
@@ -0,0 +1,46 @@
+package issue908;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.model.SelectItem;
+
+@ManagedBean
+@ViewScoped
+public class FletesController implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private List tipos;
+
+ private SelectItem selectedFlete = new SelectItem("02", "Steel");
+
+ public FletesController() {
+ tipos = new ArrayList<>();
+ getTipos().add(new SelectItem("01", "Wood"));
+ getTipos().add(new SelectItem("02", "Steel"));
+ getTipos().add(new SelectItem("03", "Plastic"));
+ }
+
+ // Listener in b:dataTable commandButton
+ public void onEdit(SelectItem flete) {
+ setSelectedFlete(new SelectItem("03", "Plastic"));
+ }
+
+ public SelectItem getSelectedFlete() {
+ return selectedFlete;
+ }
+
+ public void setSelectedFlete(SelectItem selectedFlete) {
+ this.selectedFlete = selectedFlete;
+ }
+
+ public List getTipos() {
+ return tipos;
+ }
+
+ public void setTipos(List tipos) {
+ this.tipos = tipos;
+ }
+}
diff --git a/src/main/java/net/bootsfaces/demo/BarcodeBean.java b/src/main/java/net/bootsfaces/demo/BarcodeBean.java
index 383fe70a..862cb88c 100644
--- a/src/main/java/net/bootsfaces/demo/BarcodeBean.java
+++ b/src/main/java/net/bootsfaces/demo/BarcodeBean.java
@@ -17,6 +17,7 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.event.AjaxBehaviorEvent;
import javax.faces.view.ViewScoped;
diff --git a/src/main/java/net/bootsfaces/demo/BlockUIBean.java b/src/main/java/net/bootsfaces/demo/BlockUIBean.java
index 00835c9e..18582218 100644
--- a/src/main/java/net/bootsfaces/demo/BlockUIBean.java
+++ b/src/main/java/net/bootsfaces/demo/BlockUIBean.java
@@ -22,8 +22,6 @@ public boolean isBlockUIActive() {
String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
if ("/forms/blockUI.xhtml".equals(viewId))
return true;
- if("/pages/test_newcomp.xhtml".equals(viewId))
- return true;
if("/bootstrap/SocialShare.xhtml".equals(viewId))
return true;
return false;
diff --git a/src/main/java/net/bootsfaces/demo/CarBean.java b/src/main/java/net/bootsfaces/demo/CarBean.java
index abac7a44..80460a6d 100644
--- a/src/main/java/net/bootsfaces/demo/CarBean.java
+++ b/src/main/java/net/bootsfaces/demo/CarBean.java
@@ -18,6 +18,7 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.validation.constraints.Max;
diff --git a/src/main/java/net/bootsfaces/demo/ColumnsBean.java b/src/main/java/net/bootsfaces/demo/ColumnsBean.java
index 1405971a..dae7ce76 100644
--- a/src/main/java/net/bootsfaces/demo/ColumnsBean.java
+++ b/src/main/java/net/bootsfaces/demo/ColumnsBean.java
@@ -12,6 +12,9 @@ public class ColumnsBean implements Serializable {
private boolean containerDisabled = false;
private boolean rowDisabled = false;
private boolean columnDisabled = false;
+ private int columns = 3;
+ private String colspan = "4,8";
+ private String size = "lg";
public boolean isContainerDisabled() {
return containerDisabled;
@@ -38,4 +41,28 @@ public void setColumnDisabled(boolean columnDisabled) {
}
public void onChange() {}
+
+ public int getColumns() {
+ return columns;
+ }
+
+ public void setColumns(int columns) {
+ this.columns = columns;
+ }
+
+ public String getColspan() {
+ return colspan;
+ }
+
+ public void setColspan(String colspan) {
+ this.colspan = colspan;
+ }
+
+ public String getSize() {
+ return size;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
}
diff --git a/src/main/java/net/bootsfaces/demo/DataTableSettingsBean.java b/src/main/java/net/bootsfaces/demo/DataTableSettingsBean.java
index bb99b803..15cc8358 100644
--- a/src/main/java/net/bootsfaces/demo/DataTableSettingsBean.java
+++ b/src/main/java/net/bootsfaces/demo/DataTableSettingsBean.java
@@ -18,10 +18,14 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+import java.util.List;
import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
+import de.beyondjava.jsf.sample.carshop.Car;
+
/** A simple bean for demo purposes. */
@SessionScoped
@ManagedBean
@@ -64,6 +68,12 @@ public class DataTableSettingsBean implements Serializable {
private String selectionMode = "multiple";
+ private String selectedItems = null;
+
+ private boolean showInfo = true;
+
+ private boolean deselectOnBackdropClick = false;
+
private boolean fixedHeader = false;
private boolean searchable = true;
@@ -72,6 +82,19 @@ public class DataTableSettingsBean implements Serializable {
private boolean paginated = true;
+ private boolean selectedRowsActive1 = false;
+
+ private boolean selectedRowsActive2 = false;
+
+ private Object selectedRows = "2,4,6";
+
+ private boolean selectedColumnsActive = false;
+
+ private String selectedColumns = "1,3";
+
+ @ManagedProperty("#{carPool.carPool}")
+ private List carPool;
+
public boolean isSaveState() {
return saveState;
}
@@ -355,9 +378,9 @@ public void setMultiColumnSearchPositionTop(boolean top) {
this.multiColumnSearchPosition = "bottom";
}
}
-
+
public boolean isMultiColumnSearchPositionTop() {
- return this.multiColumnSearchPosition=="top";
+ return this.multiColumnSearchPosition == "top";
}
public boolean isContentDisabled() {
@@ -367,4 +390,90 @@ public boolean isContentDisabled() {
public void setContentDisabled(boolean contentDisabled) {
this.contentDisabled = contentDisabled;
}
+
+ public boolean isDeselectOnBackdropClick() {
+ return deselectOnBackdropClick;
+ }
+
+ public void setDeselectOnBackdropClick(boolean deselectOnBackdropClick) {
+ this.deselectOnBackdropClick = deselectOnBackdropClick;
+ }
+
+ public boolean isShowInfo() {
+ return showInfo;
+ }
+
+ public void setShowInfo(boolean showInfo) {
+ this.showInfo = showInfo;
+ }
+
+ public String getSelectedItems() {
+ return selectedItems;
+ }
+
+ public boolean isSelectedRowsActive1() {
+ return selectedRowsActive1;
+ }
+
+ public void setSelectedRowsActive1(boolean selectedRowsActive) {
+ this.selectedRowsActive1 = selectedRowsActive;
+ }
+
+ public void setSelectedItems(String selectedItems) {
+ this.selectedItems = selectedItems;
+ }
+
+ public boolean isSelectedRowsActive2() {
+ return selectedRowsActive2;
+ }
+
+ public void setSelectedRowsActive2(boolean selectedRowsActive) {
+ this.selectedRowsActive2 = selectedRowsActive;
+ }
+
+ public String getSelectedColumns() {
+ if (!selectedColumnsActive) {
+ return null;
+ }
+ return selectedColumns;
+ }
+
+ public void setSelectedColumns(String selectedColumns) {
+ if (selectedColumnsActive) {
+ this.selectedColumns = selectedColumns;
+ }
+ }
+
+ public Object getSelectedRows() {
+ if (selectedRowsActive2) {
+ return this.carPool.get(2);
+ }
+ if (!selectedRowsActive1) {
+ return null;
+ }
+
+ return selectedRows;
+ }
+
+ public void setSelectedRows(Object selectedRows) {
+ if (selectedRowsActive1) {
+ this.selectedRows = selectedRows;
+ }
+ }
+
+ public boolean isSelectedColumnsActive() {
+ return selectedColumnsActive;
+ }
+
+ public void setSelectedColumnsActive(boolean selectedColumnsActive) {
+ this.selectedColumnsActive = selectedColumnsActive;
+ }
+
+ public List getCarPool() {
+ return carPool;
+ }
+
+ public void setCarPool(List carPool) {
+ this.carPool = carPool;
+ }
}
diff --git a/src/main/java/net/bootsfaces/demo/InputTextBean.java b/src/main/java/net/bootsfaces/demo/InputTextBean.java
index f4cb1469..05fe4285 100644
--- a/src/main/java/net/bootsfaces/demo/InputTextBean.java
+++ b/src/main/java/net/bootsfaces/demo/InputTextBean.java
@@ -17,9 +17,10 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
import javax.faces.bean.ManagedBean;
-import javax.faces.event.AjaxBehaviorEvent;
import javax.faces.view.ViewScoped;
/**
@@ -34,6 +35,16 @@ public class InputTextBean implements Serializable {
private String capitalText = "";
+ private Map map = new HashMap();
+
+ public String getKey() {
+ return "key";
+ }
+
+ public InputTextBean() {
+ getMap().put("key", "value");
+ }
+
public void capitalizeText() {
setCapitalText(text.toUpperCase());
}
@@ -53,4 +64,12 @@ public String getCapitalText() {
public void setCapitalText(String capitalText) {
this.capitalText = capitalText;
}
+
+ public Map getMap() {
+ return map;
+ }
+
+ public void setMap(Map map) {
+ this.map = map;
+ }
}
diff --git a/src/main/java/net/bootsfaces/demo/ItemBean.java b/src/main/java/net/bootsfaces/demo/ItemBean.java
index 955cf789..dadf99b2 100644
--- a/src/main/java/net/bootsfaces/demo/ItemBean.java
+++ b/src/main/java/net/bootsfaces/demo/ItemBean.java
@@ -1,6 +1,7 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.model.ArrayDataModel;
diff --git a/src/main/java/net/bootsfaces/demo/LoginBean.java b/src/main/java/net/bootsfaces/demo/LoginBean.java
index a590ee3d..ad13d4b8 100644
--- a/src/main/java/net/bootsfaces/demo/LoginBean.java
+++ b/src/main/java/net/bootsfaces/demo/LoginBean.java
@@ -4,7 +4,6 @@
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.validation.constraints.Size;
diff --git a/src/main/java/net/bootsfaces/demo/MessagesBean.java b/src/main/java/net/bootsfaces/demo/MessagesBean.java
index fbc78ce3..70aaafda 100644
--- a/src/main/java/net/bootsfaces/demo/MessagesBean.java
+++ b/src/main/java/net/bootsfaces/demo/MessagesBean.java
@@ -6,6 +6,7 @@
import java.io.Serializable;
import java.util.Date;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.event.ActionEvent;
@@ -13,6 +14,7 @@
import javax.validation.constraints.Min;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
+
import net.bootsfaces.utils.FacesMessages;
/**
diff --git a/src/main/java/net/bootsfaces/demo/NumberGuessBean.java b/src/main/java/net/bootsfaces/demo/NumberGuessBean.java
index d843fd48..b082966c 100644
--- a/src/main/java/net/bootsfaces/demo/NumberGuessBean.java
+++ b/src/main/java/net/bootsfaces/demo/NumberGuessBean.java
@@ -4,14 +4,10 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
-import net.bootsfaces.expressions.ExpressionResolver;
import net.bootsfaces.utils.FacesMessages;
@ManagedBean
diff --git a/src/main/java/net/bootsfaces/demo/PollDemoBean.java b/src/main/java/net/bootsfaces/demo/PollDemoBean.java
index a1872a54..628e08a2 100644
--- a/src/main/java/net/bootsfaces/demo/PollDemoBean.java
+++ b/src/main/java/net/bootsfaces/demo/PollDemoBean.java
@@ -2,6 +2,7 @@
import java.io.Serializable;
import java.util.Date;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
diff --git a/src/main/java/net/bootsfaces/demo/SelectMultiMenuBean.java b/src/main/java/net/bootsfaces/demo/SelectMultiMenuBean.java
index 8494067d..0722d298 100644
--- a/src/main/java/net/bootsfaces/demo/SelectMultiMenuBean.java
+++ b/src/main/java/net/bootsfaces/demo/SelectMultiMenuBean.java
@@ -18,14 +18,13 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
-import javax.faces.context.FacesContext;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
-import net.bootsfaces.expressions.ExpressionResolver;
import net.bootsfaces.utils.FacesMessages;
/** A simple bean for demo purposes. */
diff --git a/src/main/java/net/bootsfaces/demo/SelectOneMenuBean.java b/src/main/java/net/bootsfaces/demo/SelectOneMenuBean.java
index 39c2d02a..cdf70d96 100644
--- a/src/main/java/net/bootsfaces/demo/SelectOneMenuBean.java
+++ b/src/main/java/net/bootsfaces/demo/SelectOneMenuBean.java
@@ -18,6 +18,7 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.validation.constraints.Max;
diff --git a/src/main/java/net/bootsfaces/demo/SemaphoreBean.java b/src/main/java/net/bootsfaces/demo/SemaphoreBean.java
index 8d78c72f..e417c55b 100644
--- a/src/main/java/net/bootsfaces/demo/SemaphoreBean.java
+++ b/src/main/java/net/bootsfaces/demo/SemaphoreBean.java
@@ -21,6 +21,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.validation.constraints.NotNull;
diff --git a/src/main/java/net/bootsfaces/demo/SettingsBean.java b/src/main/java/net/bootsfaces/demo/SettingsBean.java
index 3406bf3a..1c64f848 100644
--- a/src/main/java/net/bootsfaces/demo/SettingsBean.java
+++ b/src/main/java/net/bootsfaces/demo/SettingsBean.java
@@ -18,6 +18,7 @@
package net.bootsfaces.demo;
import java.io.Serializable;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
diff --git a/src/main/java/net/bootsfaces/demo/TestBean.java b/src/main/java/net/bootsfaces/demo/TestBean.java
index 9cc79377..cb64d5ed 100644
--- a/src/main/java/net/bootsfaces/demo/TestBean.java
+++ b/src/main/java/net/bootsfaces/demo/TestBean.java
@@ -5,6 +5,9 @@
*/
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@@ -26,8 +29,11 @@ public class TestBean implements Serializable {
private String label2 = "Label Two";
private String text1 = "Text One";
private String text2 = "Text Two";
+ private List tabs = new ArrayList<>();
- private boolean contentDisabled=false;
+ private Calculation calc = new Calculation("static calculation");
+
+ private boolean contentDisabled = false;
private int index = 2;
@@ -121,6 +127,9 @@ public void setText2(String text2) {
* Creates a new instance of informBean
*/
public TestBean() {
+ tabs.add(new Calculation("first tab"));
+ tabs.add(new Calculation("second tab"));
+ tabs.add(new Calculation("third tab"));
}
public int getIndex() {
@@ -138,9 +147,68 @@ public boolean isContentDisabled() {
public void setContentDisabled(boolean contentDisabled) {
this.contentDisabled = contentDisabled;
}
-
+
// dummy method for AJAX
public void onClick() {
+
+ }
+
+ public List getTabs() {
+ return tabs;
+ }
+
+ public Calculation getCalc() {
+ return calc;
+ }
+
+ public void setCalc(Calculation calc) {
+ this.calc = calc;
+ }
+
+ public class Calculation {
+ private String title;
+ private int summand1 = (int) (Math.random() * 100.0d);
+ private int summand2 = (int) (Math.random() * 100.0d);
+ private int sum = 0;
+ public Calculation(String title) {
+ this.title=title;
+ }
+
+ public int getSum() {
+ return sum;
+ }
+
+ public void setSum(int sum) {
+ this.sum = sum;
+ }
+
+ public int getSummand1() {
+ return summand1;
+ }
+
+ public void setSummand1(int summand1) {
+ this.summand1 = summand1;
+ }
+
+ public int getSummand2() {
+ return summand2;
+ }
+
+ public void setSummand2(int summand2) {
+ this.summand2 = summand2;
+ }
+
+ public void add() {
+ sum = summand1 + summand2;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
}
}
diff --git a/src/main/java/net/bootsfaces/demo/VersionsBean.java b/src/main/java/net/bootsfaces/demo/VersionsBean.java
new file mode 100644
index 00000000..d7384748
--- /dev/null
+++ b/src/main/java/net/bootsfaces/demo/VersionsBean.java
@@ -0,0 +1,43 @@
+package net.bootsfaces.demo;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+import javax.faces.context.FacesContext;
+
+import net.bootsfaces.listeners.AddResourcesListener;
+
+/**
+ * ManagedBean which holds the version numbers of used frameworks.
+ */
+@ManagedBean(name="versions")
+@ApplicationScoped
+public class VersionsBean {
+ private final static String bsfVersion, jsfImplementationVersion;
+// primefacesVersion,
+// omniFacesVersion,
+
+
+ static {
+ bsfVersion = AddResourcesListener.class.getPackage().getImplementationVersion();
+// primefacesVersion = RequestContext.getCurrentInstance().
+// getApplicationContext().getConfig().getBuildVersion();
+// omniFacesVersion = Faces.class.getPackage().getImplementationVersion();
+ jsfImplementationVersion = FacesContext.class.getPackage().getImplementationVersion();
+ }
+
+// public String getPrimefacesVersion() {
+// return primefacesVersion;
+// }
+
+ public String getBsfVersion() {
+ return bsfVersion;
+ }
+
+// public String getOmnifacesversion() {
+// return omniFacesVersion;
+// }
+
+ public String getJsfImplementationVersion() {
+ return jsfImplementationVersion;
+ }
+}
diff --git a/src/main/java/net/bootsfaces/demo/ajax/AjaxBean.java b/src/main/java/net/bootsfaces/demo/ajax/AjaxBean.java
index a2dfb014..26f57a1e 100644
--- a/src/main/java/net/bootsfaces/demo/ajax/AjaxBean.java
+++ b/src/main/java/net/bootsfaces/demo/ajax/AjaxBean.java
@@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
diff --git a/src/main/java/net/bootsfaces/demo/ajax/NavigationBean.java b/src/main/java/net/bootsfaces/demo/ajax/NavigationBean.java
index 51412ea7..298c70bb 100644
--- a/src/main/java/net/bootsfaces/demo/ajax/NavigationBean.java
+++ b/src/main/java/net/bootsfaces/demo/ajax/NavigationBean.java
@@ -1,11 +1,9 @@
package net.bootsfaces.demo.ajax;
-import java.io.IOException;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
-import javax.faces.context.FacesContext;
@ManagedBean
@SessionScoped
diff --git a/src/main/java/net/bootsfaces/demo/forms/FormBean.java b/src/main/java/net/bootsfaces/demo/forms/FormBean.java
index 54dfed8e..d39e5b70 100644
--- a/src/main/java/net/bootsfaces/demo/forms/FormBean.java
+++ b/src/main/java/net/bootsfaces/demo/forms/FormBean.java
@@ -3,7 +3,6 @@
import java.util.Date;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
@ManagedBean
diff --git a/src/main/java/net/bootsfaces/demo/imageGallery/ImageGallery.java b/src/main/java/net/bootsfaces/demo/imageGallery/ImageGallery.java
index bc545f99..f8bf84f9 100644
--- a/src/main/java/net/bootsfaces/demo/imageGallery/ImageGallery.java
+++ b/src/main/java/net/bootsfaces/demo/imageGallery/ImageGallery.java
@@ -6,8 +6,6 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
import net.bootsfaces.utils.FacesMessages;
diff --git a/src/main/java/net/bootsfaces/demo/layout/IconAwesomeBean.java b/src/main/java/net/bootsfaces/demo/layout/IconAwesomeBean.java
index 46128ea5..113336ed 100644
--- a/src/main/java/net/bootsfaces/demo/layout/IconAwesomeBean.java
+++ b/src/main/java/net/bootsfaces/demo/layout/IconAwesomeBean.java
@@ -9,6 +9,7 @@
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
diff --git a/src/main/java/net/bootsfaces/issues/issue360/Crowd.java b/src/main/java/net/bootsfaces/issues/issue360/Crowd.java
index 0ecdea75..424ef946 100644
--- a/src/main/java/net/bootsfaces/issues/issue360/Crowd.java
+++ b/src/main/java/net/bootsfaces/issues/issue360/Crowd.java
@@ -1,16 +1,12 @@
package net.bootsfaces.issues.issue360;
-import java.io.IOException;
import java.io.Serializable;
-import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import net.bootsfaces.utils.FacesMessages;
-
@ManagedBean
@ViewScoped
public class Crowd implements Serializable {
diff --git a/src/main/java/net/bootsfaces/issues/issue360/Names.java b/src/main/java/net/bootsfaces/issues/issue360/Names.java
index af58379f..8fb7b013 100644
--- a/src/main/java/net/bootsfaces/issues/issue360/Names.java
+++ b/src/main/java/net/bootsfaces/issues/issue360/Names.java
@@ -1,12 +1,11 @@
package net.bootsfaces.issues.issue360;
-import java.util.List;
import java.io.BufferedReader;
-import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.List;
public class Names {
private static List names = null;
diff --git a/src/main/java/net/bootsfaces/menu/ComponentList.java b/src/main/java/net/bootsfaces/menu/ComponentList.java
new file mode 100644
index 00000000..60cb0645
--- /dev/null
+++ b/src/main/java/net/bootsfaces/menu/ComponentList.java
@@ -0,0 +1,89 @@
+package net.bootsfaces.menu;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+
+public class ComponentList {
+
+ static Map docFiles = new HashMap<>();
+
+ static String[] tags = null;
+
+ static {
+ String root = ((ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext())
+ .getRealPath("/");
+ scanFolder(new File(root), root.length());
+ Object[] keySet = docFiles.keySet().toArray();
+ Arrays.sort(keySet);
+ tags = new String[keySet.length];
+ for (int i = 0; i < keySet.length; i++) {
+ tags[i] = (String) keySet[i];
+ }
+ }
+
+ public static void scanFolder(File folder, int charactersToIgnore) {
+ File[] files = folder.listFiles();
+ for (File file : files) {
+ if (file.isDirectory()) {
+ scanFolder(file, charactersToIgnore);
+ } else if (file.getName().endsWith(".xhtml")) {
+ if (!file.getName().endsWith("Attributes.xhtml")) {
+ readFile(file.getAbsolutePath(), charactersToIgnore);
+ }
+ }
+ }
+ }
+
+ public static void readFile(String filename, int charactersToIgnore) {
+ BufferedReader br = null;
+ FileReader fr = null;
+
+ try {
+ fr = new FileReader(filename);
+ br = new BufferedReader(fr);
+ String sCurrentLine;
+
+ while ((sCurrentLine = br.readLine()) != null) {
+ if (sCurrentLine.contains("Attributes.xhtml")) {
+ int end = sCurrentLine.indexOf("Attributes.xhtml");
+ int start = sCurrentLine.lastIndexOf('"', end);
+ if (start >= 0) {
+ String tag = sCurrentLine.substring(start + 1, end);
+ if (tag.contains("/")) {
+ start = tag.indexOf("/");
+ tag = tag.substring(start + 1);
+ }
+ tag = tag.substring(0, 1).toLowerCase() + tag.substring(1);
+
+ String url = filename.substring(charactersToIgnore, filename.length());
+ url = url.replace("\\", "/").replace(".xhtml", ".jsf");
+ docFiles.put("<" + tag + ">", url);
+ }
+ }
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+
+ } finally {
+ try {
+ if (br != null)
+ br.close();
+
+ if (fr != null)
+ fr.close();
+
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/src/main/java/net/bootsfaces/menu/ComponentListBean.java b/src/main/java/net/bootsfaces/menu/ComponentListBean.java
new file mode 100644
index 00000000..eda73bfa
--- /dev/null
+++ b/src/main/java/net/bootsfaces/menu/ComponentListBean.java
@@ -0,0 +1,75 @@
+package net.bootsfaces.menu;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+@ManagedBean
+@SessionScoped
+public class ComponentListBean {
+
+ private String filter = null;
+
+ private String[] filteredTags = ComponentList.tags;
+
+ public String[] getTags() {
+ return filteredTags;
+ }
+
+ public String url(String component) {
+ return ComponentList.docFiles.get(component);
+ }
+
+ public String getFilter() {
+ return filter;
+ }
+
+ public void setFilter(String filter) {
+ if (filter == null || filter.trim().equals("")) {
+ filteredTags = ComponentList.tags;
+ this.filter = filter;
+ } else {
+ filter = filter.replace(" result = new ArrayList<>(ComponentList.tags.length);
+ for (String s: ComponentList.tags) {
+ if (s.toLowerCase().contains(smallFilter)) {
+ result.add(s);
+ }
+ }
+ filteredTags = result.toArray(new String[result.size()]);
+ }
+ }
+
+ public String[] getFilteredTags() {
+ return filteredTags;
+ }
+
+ public void setFilteredTags(String[] filteredTags) {
+ this.filteredTags = filteredTags;
+ }
+
+ public void updateFilter() { }
+
+ public String getDisplayName(String c) {
+ c = c.replace("<", "").replace(">", "");
+ c = c.substring(0, 1).toUpperCase() + c.substring(1);
+ return c;
+ }
+
+ public String addSlashIfNecessary(String path) {
+ if (path.length() <= 1) {
+ return path;
+ }
+ if (path.endsWith("/")) {
+ return path;
+ }
+ return path + "/";
+ }
+}
diff --git a/src/main/webapp/WEB-INF/faces-config.xml b/src/main/webapp/WEB-INF/faces-config.xml
index 505dfad6..035c8828 100644
--- a/src/main/webapp/WEB-INF/faces-config.xml
+++ b/src/main/webapp/WEB-INF/faces-config.xml
@@ -1,7 +1,4 @@
-
- org.omnifaces.resourcehandler.CombinedResourceHandler
-
\ No newline at end of file
diff --git a/src/main/webapp/applayout/componentSidebar.xhtml b/src/main/webapp/applayout/componentSidebar.xhtml
new file mode 100644
index 00000000..fea8f5d7
--- /dev/null
+++ b/src/main/webapp/applayout/componentSidebar.xhtml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Concepts
+
+
+
+
+
+ Components
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/applayout/navbarbottom.xhtml b/src/main/webapp/applayout/navbarbottom.xhtml
index c1a727dc..1d719374 100644
--- a/src/main/webapp/applayout/navbarbottom.xhtml
+++ b/src/main/webapp/applayout/navbarbottom.xhtml
@@ -1,11 +1,12 @@
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:b="http://bootsfaces.net/ui">
-
-
-
+
+
+
+
diff --git a/src/main/webapp/applayout/navbartop.xhtml b/src/main/webapp/applayout/navbartop.xhtml
index 54978f61..7692d814 100644
--- a/src/main/webapp/applayout/navbartop.xhtml
+++ b/src/main/webapp/applayout/navbartop.xhtml
@@ -1,35 +1,31 @@
+ 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:b="http://bootsfaces.net/ui"
+ xmlns:jsf="http://xmlns.jcp.org/jsf"
+ xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
-
-
+
+ style="padding-top:2px;padding-bottom:2px" brand-target="_blank">
@@ -37,7 +33,7 @@
-
+
@@ -74,36 +70,37 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -184,7 +181,7 @@
+ onchange="$('.theme-selector-button').click()">
@@ -207,7 +204,7 @@
+ style="display:none" />
diff --git a/src/main/webapp/applayout/pageTemplate.xhtml b/src/main/webapp/applayout/pageTemplate.xhtml
index 82067ebc..2f47483d 100644
--- a/src/main/webapp/applayout/pageTemplate.xhtml
+++ b/src/main/webapp/applayout/pageTemplate.xhtml
@@ -6,80 +6,119 @@
xmlns:b="http://bootsfaces.net/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
-
- BootsFaces: the next-gen JSF Framework based on Bootstrap
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ BootsFaces: the next-gen JSF Framework based on Bootstrap
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+