Author: tkuprevich
Date: 2009-03-27 06:27:51 -0400 (Fri, 27 Mar 2009)
New Revision: 13240
Added:
trunk/test-applications/jsp/src/main/java/colorPicker/ColorPickerConverter.java
Modified:
trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java 2009-03-27
09:32:36 UTC (rev 13239)
+++ trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java 2009-03-27
10:27:51 UTC (rev 13240)
@@ -22,14 +22,26 @@
private boolean immediate;
private boolean localValueSet;
private boolean rendered;
+ private boolean facets;
private boolean required;
private String requiredMessage;
private boolean valid;
private String validatorMessage;
private String value;
+ private String facetsValue;
private String bindLabel;
+ private String showEvent;
+ public String getShowEvent() {
+ return showEvent;
+ }
+
+ public void setShowEvent(String showEvent) {
+ this.showEvent = showEvent;
+ }
+
public ColorPicker() {
+ facets = false;
colorMode = "rgb";
converterMessage = "custom converter message";
flat = false;
@@ -41,7 +53,9 @@
valid = true;
validatorMessage = "custom validator message";
value = "rgb(255, 250, 240)";
+ facetsValue = "rgb(0, 0, 0)";
bindLabel = "Click Binding";
+ showEvent = "onclick";
}
public void checkBinding(ActionEvent e){
@@ -69,9 +83,10 @@
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
+ System.out.println("<<<Color Picker Validator Works>>>");
String str = value.toString();
if (str.startsWith("rgb")) {
- if (str.indexOf("100") != -1)
+ if (str.indexOf("56") != -1)
throw new ValidatorException(new FacesMessage(
"Test validator: 100 is restricted!"));
}
@@ -187,4 +202,21 @@
this.bindLabel = bindLabel;
}
+ public boolean isFacets() {
+ return facets;
+ }
+
+ public void setFacets(boolean facets) {
+ this.facets = facets;
+ }
+
+ public String getFacetsValue() {
+ return facetsValue;
+ }
+
+ public void setFacetsValue(String facetsValue) {
+ this.facetsValue = facetsValue;
+ }
+
+
}
Added: trunk/test-applications/jsp/src/main/java/colorPicker/ColorPickerConverter.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/colorPicker/ColorPickerConverter.java
(rev 0)
+++
trunk/test-applications/jsp/src/main/java/colorPicker/ColorPickerConverter.java 2009-03-27
10:27:51 UTC (rev 13240)
@@ -0,0 +1,30 @@
+package colorPicker;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.swing.tree.TreeNode;
+import util.data.*;
+
+public class ColorPickerConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ System.out.println("<<<ColorPicker Converter getAsObject()
Called>>>");
+ String str = value.toString();
+ return str;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ System.out.println("<<<ColorPicker Converter getAsString()
Called>>>");
+ if (value instanceof String) {
+ String str = value.toString();
+ return str;
+ } else
+ throw new ConverterException(
+ "Test Application: Error in custom converted
colorPicker.ColorPickerConverter.java");
+ }
+
+}
Show replies by date