JBoss Rich Faces SVN: r8080 - in trunk/ui: dropdown-menu/src/main/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-04-22 14:28:57 -0400 (Tue, 22 Apr 2008)
New Revision: 8080
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-3022
Modified: trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
--- trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-04-22 17:47:08 UTC (rev 8079)
+++ trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-04-22 18:28:57 UTC (rev 8080)
@@ -21,10 +21,14 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIContextMenu;
import org.richfaces.component.UIMenuGroup;
@@ -114,4 +118,19 @@
protected InternetResource[] getStyles() {
return super.getStyles();
}
+
+ protected void processLayerStyles(FacesContext context, UIComponent layer, ResponseWriter writer) throws IOException {
+ Object style = layer.getAttributes().get(HTML.style_ATTRIBUTE);
+ Object styleClass = layer.getAttributes().get(HTML.STYLE_CLASS_ATTR);
+
+ if (null == style) {
+ style = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border rich-menu-list-border " + styleClass, null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " + style, null);
+ }
}
Modified: trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-04-22 17:47:08 UTC (rev 8079)
+++ trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-04-22 18:28:57 UTC (rev 8080)
@@ -25,8 +25,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDropDownMenu;
import org.richfaces.component.UIMenuGroup;
import org.richfaces.renderkit.ScriptOptions;
@@ -113,4 +115,9 @@
super.encodeChildren(context, component);
}
+ protected void processLayerStyles(FacesContext context, UIComponent layer, ResponseWriter writer) throws IOException {
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border rich-menu-list-border", null);
+ writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2;", null);
+ }
+
}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-04-22 17:47:08 UTC (rev 8079)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-04-22 18:28:57 UTC (rev 8080)
@@ -143,21 +143,10 @@
public void processLayer(FacesContext context, UIComponent layer, String width) throws IOException {
String clientId = layer.getClientId(context);
- Object style = layer.getAttributes().get(HTML.style_ATTRIBUTE);
- Object styleClass = layer.getAttributes().get(HTML.STYLE_CLASS_ATTR);
-
- if (null == style) {
- style = "";
- }
- if (null == styleClass) {
- styleClass = "";
- }
-
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.id_ATTRIBUTE, clientId+"_menu", null);
- writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-border rich-menu-list-border " + styleClass, null);
- writer.writeAttribute(HTML.style_ATTRIBUTE, "display: none; z-index: 2; " + style, null);
+ processLayerStyles(context, layer, writer);
writer.startElement(HTML.DIV_ELEM, layer);
writer.writeAttribute(HTML.class_ATTRIBUTE, "dr-menu-list-bg rich-menu-list-bg", null);
encodeItems(context, layer);
@@ -210,5 +199,7 @@
}
}
}
+
+ protected abstract void processLayerStyles(FacesContext context, UIComponent layer, ResponseWriter writer) throws IOException;
}
16 years, 8 months
JBoss Rich Faces SVN: r8079 - in branches/3.1.x/test-applications/jsp/src/main: webapp/OrderingList and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-04-22 13:47:08 -0400 (Tue, 22 Apr 2008)
New Revision: 8079
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
Log:
valueChangeListener & activeItem were added
Modified: branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-22 17:21:16 UTC (rev 8078)
+++ branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-22 17:47:08 UTC (rev 8079)
@@ -7,11 +7,11 @@
import javax.faces.component.html.HtmlDataTable;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
-
+import javax.faces.event.ValueChangeEvent;
import util.data.Data;
public class OrderingList{
- private String bindingCheck;
+ private String bindLabel;
private HtmlOrderingList myOrderingList;
private ArrayList<String> info;
private ArrayList<Data> list;
@@ -27,6 +27,7 @@
private String listHeight;
private String listWidth;
private int lenght;
+ private Object activeItem = new Object();
private boolean orderControlsVisible;
private boolean fastOrderControlsVisible;
private boolean rendered;
@@ -37,10 +38,11 @@
public void bindingCheck(ActionEvent actionEvent){
FacesContext faces = FacesContext.getCurrentInstance();
- bindingCheck = "Passed";
+ bindLabel = "Passed";
System.out.println("============OL Binding Check===========");
System.out.println(myOrderingList.getBaseClientId(faces));
System.out.println("============OL Binding Check===========");
+ System.out.println(activeItem.toString());
}
public boolean isFacet() {
@@ -81,7 +83,7 @@
}
public OrderingList() {
- this.bindingCheck = "Not checked";
+ this.bindLabel = "Not checked";
this.info = new ArrayList<String>();
this.captionLabel = "captionLabel";
this.lenght = 10;
@@ -101,6 +103,7 @@
this.showAllData = true;
this.showSelect = true;
this.list = new ArrayList<Data>();
+ //this.activeItem = 1;
addNewItem();
}
@@ -373,11 +376,22 @@
this.myOrderingList = myOrderingList;
}
- public String getBindingCheck() {
- return bindingCheck;
+ public Object getActiveItem() {
+ return activeItem;
}
- public void setBindingCheck(String bindingCheck) {
- this.bindingCheck = bindingCheck;
+ public void setActiveItem(Object activeItem) {
+ this.activeItem = activeItem;
}
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+ public void valueChangeListener(ValueChangeEvent valueChangeEvent){
+ System.out.println("ValueChangeListener work:" + myOrderingList.getActiveItem());
+ }
}
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-22 17:21:16 UTC (rev 8078)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-22 17:47:08 UTC (rev 8079)
@@ -9,7 +9,7 @@
<h:messages />
</a4j:outputPanel>
- <rich:orderingList id="orderingListID" immediate="false"
+ <rich:orderingList id="orderingListID" immediate="true"
binding="#{orderingList.myOrderingList}" value="#{orderingList.list}"
var="item" listHeight="#{orderingList.listHeight}"
listWidth="#{orderingList.listWidth}"
@@ -36,8 +36,10 @@
ontopclick="showEvent('ontopclickInputID', 'ontopclick work!')"
onupclick="showEvent('onupclickInputID', 'onupclick work!')"
ondownclick="showEvent('ondownclickInputID', 'ondownclick work!')"
- onbottomclick="showEvent('onbottomclickInputID', 'onbottomclick work!')"
- onheaderclick="showEvent('onheaderclickInputID', 'onheaderclick work!')">
+ onbottomclick="alert('onbottomclick')"
+ onheaderclick="alert('onheaderclick')"
+ activeItem="#{orderingList.activeItem}"
+ rowClasses="rowA, rowB" valueChangeListener="#{orderingList.valueChangeListener}">
<f:facet name="header">
<h:outputText value="header" />
</f:facet>
@@ -114,7 +116,7 @@
<h:panelGrid columns="2">
<a4j:commandButton reRender="outBindingCheck" actionListener="#{orderingList.bindingCheck}"
value="binding Check" />
- <h:outputText id="outBindingCheck" value="#{orderingList.bindingCheck}" />
+ <h:outputText id="outBindingCheck" value="#{orderingList.bindLabel}" />
</h:panelGrid>
<h:panelGrid columns="3">
16 years, 8 months
JBoss Rich Faces SVN: r8078 - in trunk/framework/impl/src/main/java/org: richfaces/renderkit/html and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-22 13:21:16 -0400 (Tue, 22 Apr 2008)
New Revision: 8078
Added:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ResourceElement.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
Log:
baseSkin skin parameter handling implemented
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ResourceElement.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ResourceElement.java 2008-04-22 16:58:34 UTC (rev 8077)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ResourceElement.java 2008-04-22 17:21:16 UTC (rev 8078)
@@ -40,6 +40,22 @@
public class ResourceElement extends ElementBase {
private Map attrs = new HashMap();
+
+ private Map<String, Object> createParameterMap(TemplateContext context) {
+ //usefullness of lazy evaluation here is doubtful for me - nick
+ Map<String, Object> result = new HashMap<String, Object>();
+
+ for (Object object : getChildren()) {
+ if (object instanceof AttributeElement) {
+ AttributeElement attribute = (AttributeElement) object;
+
+ result.put(attribute.getName(), attribute.getValue(context));
+ }
+ }
+
+ return result;
+ }
+
/* (non-Javadoc)
* @see java.util.Map#put(java.lang.Object, java.lang.Object)
*/
@@ -60,7 +76,12 @@
public void encodeBegin(TemplateContext context) throws IOException {
InternetResource resource = findResource(context);
if(null !=resource){
- resource.encodeBegin(context.getFacesContext(),context.getComponent(),attrs);
+ Object dataParameter = context.getComponent();
+ if (dataParameter == null) {
+ dataParameter = createParameterMap(context);
+ }
+
+ resource.encodeBegin(context.getFacesContext(), dataParameter, attrs);
}
}
@@ -70,7 +91,12 @@
public void encodeEnd(TemplateContext context) throws IOException {
InternetResource resource = findResource(context);
if(null !=resource){
- resource.encodeEnd(context.getFacesContext(),context.getComponent());
+ Object dataParameter = context.getComponent();
+ if (dataParameter == null) {
+ dataParameter = createParameterMap(context);
+ }
+
+ resource.encodeEnd(context.getFacesContext(), dataParameter);
}
}
@@ -80,7 +106,12 @@
public String getString(TemplateContext context) throws FacesException {
InternetResource resource = findResource(context);
if(null !=resource){
- return resource.getUri(context.getFacesContext(),context.getComponent());
+ Object dataParameter = context.getComponent();
+ if (dataParameter == null) {
+ dataParameter = createParameterMap(context);
+ }
+
+ return resource.getUri(context.getFacesContext(), dataParameter);
}
return "";
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2008-04-22 16:58:34 UTC (rev 8077)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2008-04-22 17:21:16 UTC (rev 8078)
@@ -26,9 +26,11 @@
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.Date;
+import java.util.Map;
import javax.faces.context.FacesContext;
@@ -38,6 +40,7 @@
import org.ajax4jsf.resource.ResourceContext;
import org.ajax4jsf.util.HtmlColor;
import org.ajax4jsf.util.Zipper2;
+import org.richfaces.renderkit.html.images.GradientAlignment;
import org.richfaces.renderkit.html.images.GradientType;
import org.richfaces.renderkit.html.images.GradientType.BiColor;
import org.richfaces.skin.Skin;
@@ -50,48 +53,48 @@
*/
public class BaseGradient extends Java2Dresource {
- private int width;
- private int height;
- private int gradientHeight;
- private String baseColor;
- private String gradientColor;
+ private int width;
+ private int height;
+ private int gradientHeight;
+ private String baseColor;
+ private String gradientColor;
private boolean horizontal = false;
-
- public BaseGradient(int width, int height, int gradientHeight) {
- super();
- this.width = width;
- this.height = height;
- this.gradientHeight = gradientHeight;
- setRenderer(new PngRenderer());
- setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
- }
+ public BaseGradient(int width, int height, int gradientHeight) {
+ super();
+ this.width = width;
+ this.height = height;
+ this.gradientHeight = gradientHeight;
- public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor) {
- this(width, height, gradientHeight);
- this.baseColor = baseColor;
- this.gradientColor = gradientColor;
- }
+ setRenderer(new PngRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
- public BaseGradient(int width, int height) {
- this(width, height, height);
- }
+ public BaseGradient(int width, int height, int gradientHeight, String baseColor, String gradientColor) {
+ this(width, height, gradientHeight);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
- public BaseGradient(int width, int height, String baseColor, String gradientColor) {
- this(width, height, height);
- this.baseColor = baseColor;
- this.gradientColor = gradientColor;
- }
+ public BaseGradient(int width, int height) {
+ this(width, height, height);
+ }
- public BaseGradient() {
- this(30, 50, 20);
- }
-
- public BaseGradient(String baseColor, String gradientColor) {
- this(30, 50, 20);
- this.baseColor = baseColor;
- this.gradientColor = gradientColor;
- }
+ public BaseGradient(int width, int height, String baseColor, String gradientColor) {
+ this(width, height, height);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
+
+ public BaseGradient() {
+ this(30, 50, 20);
+ }
+
+ public BaseGradient(String baseColor, String gradientColor) {
+ this(30, 50, 20);
+ this.baseColor = baseColor;
+ this.gradientColor = gradientColor;
+ }
public BaseGradient(int width, int height, int gradientHeight, boolean horizontal) {
this(width, height, gradientHeight);
@@ -129,202 +132,279 @@
this.horizontal = horizontal;
}
- public Dimension getDimensions(FacesContext facesContext, Object data) {
- return new Dimension(width, height);
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return new Dimension(width, height);
+ }
+
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return getDimensions(null, restoreData(resourceContext));
+ }
+
+ private void drawRectangle(Graphics2D g2d, Rectangle2D rect, BiColor biColor, boolean useTop) {
+ if (biColor != null) {
+ Color color = useTop ? biColor.getTopColor() : biColor.getBottomColor();
+ g2d.setColor(color);
+ g2d.fill(rect);
}
+ }
- protected Dimension getDimensions(ResourceContext resourceContext) {
- return getDimensions(null, restoreData(resourceContext));
+ private void drawGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height) {
+ if (colors != null) {
+ GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
+ g2d.setPaint(gragient);
+ g2d.fill(rectangle);
}
-
- private void drawGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height, boolean horizontal) {
- if (colors != null) {
- GradientPaint gragient;
+ }
+
+ protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+
+ Data dataToStore = (Data) restoreData(resourceContext);
+ if (dataToStore != null) {
+ Integer headerBackgroundColor = dataToStore.getHeaderBackgroundColor();
+ Integer headerGradientColor = dataToStore.getHeaderGradientColor();
+
+ if (headerBackgroundColor != null && headerGradientColor != null) {
+ Color baseColor = new Color(headerBackgroundColor.intValue());
+ Color alternateColor = new Color(headerGradientColor.intValue());
+ BiColor biColor = new GradientType.BiColor(baseColor, alternateColor);
+
+ GradientType type = dataToStore.getGradientType();
+ BiColor firstLayer = type.getFirstLayerColors(biColor);
+ BiColor secondLayer = type.getSecondLayerColors(biColor);
+
+ Dimension dim = getDimensions(resourceContext);
+
if (horizontal) {
- gragient = new GradientPaint(0, 0, colors.getTopColor(), height, 0, colors.getBottomColor());
- } else {
- gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
+ //x -> y, y -> x
+ g2d.transform(new AffineTransform(0, 1, 1, 0, 0, 0));
+ dim.setSize(dim.height, dim.width);
}
+
+ Rectangle2D rect =
+ new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
- g2d.setPaint(gragient);
- g2d.fill(rectangle);
- }
- }
+ GradientAlignment gradientAlignment = dataToStore.getGradientAlignment();
+ int topRectangleHeight = gradientAlignment.getTopRectangleHeight(dim.height, gradientHeight);
+ int bottomRectangleHeight = gradientAlignment.getBottomRectangleHeight(dim.height, gradientHeight);
- protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ topRectangleHeight);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+ drawRectangle(g2d, rect, firstLayer, true);
+ drawRectangle(g2d, rect, secondLayer, true);
- Data dataToStore = (Data) restoreData(resourceContext);
- if (dataToStore != null) {
- Integer headerBackgroundColor = dataToStore.getHeaderBackgroundColor();
- Integer headerGradientColor = dataToStore.getHeaderGradientColor();
+ rect = new Rectangle2D.Float(
+ 0,
+ dim.height - bottomRectangleHeight,
+ dim.width,
+ dim.height);
- if (headerBackgroundColor != null && headerGradientColor != null) {
- Color baseColor = new Color(headerBackgroundColor.intValue());
- Color alternateColor = new Color(headerGradientColor.intValue());
- BiColor biColor = new GradientType.BiColor(baseColor, alternateColor);
+ drawRectangle(g2d, rect, firstLayer, false);
+ drawRectangle(g2d, rect, secondLayer, false);
- GradientType type = dataToStore.getGradientType();
- BiColor firstLayer = type.getFirstLayerColors(biColor);
- BiColor secondLayer = type.getSecondLayerColors(biColor);
+ g2d.transform(AffineTransform.getTranslateInstance(0, topRectangleHeight));
- Dimension dim = getDimensions(resourceContext);
- Rectangle2D rect =
- new Rectangle2D.Float(
- 0,
- 0,
- dim.width,
- dim.height);
+ rect = new Rectangle2D.Float(
+ 0,
+ 0,
+ dim.width,
+ dim.height);
- drawGradient(g2d, rect, firstLayer, gradientHeight, horizontal);
- drawGradient(g2d, rect, secondLayer, gradientHeight / 2, horizontal);
- }
+ drawGradient(g2d, rect, firstLayer, gradientHeight);
+ drawGradient(g2d, rect, secondLayer, gradientHeight / 2);
}
}
+ }
- protected void restoreData(Data data, Zipper2 zipper2) {
- if (zipper2.hasMore()) {
- data.setHeaderBackgroundColor(Integer.valueOf(zipper2.nextIntColor()));
- data.setHeaderGradientColor(Integer.valueOf(zipper2.nextIntColor()));
- data.setGradientType(GradientType.values()[zipper2.nextByte()]);
- }
+ protected void restoreData(Data data, Zipper2 zipper2) {
+ if (zipper2.hasMore()) {
+ data.setHeaderBackgroundColor(Integer.valueOf(zipper2.nextIntColor()));
+ data.setHeaderGradientColor(Integer.valueOf(zipper2.nextIntColor()));
+ data.setGradientType(GradientType.values()[zipper2.nextByte()]);
+ data.setGradientAlignment(GradientAlignment.values()[zipper2.nextByte()]);
}
-
- protected Object deserializeData(byte[] objectArray) {
- Data data = createData();
- if (objectArray != null) {
- Zipper2 zipper2 = new Zipper2(objectArray);
- restoreData(data, zipper2);
- }
+ }
- return data;
+ protected Object deserializeData(byte[] objectArray) {
+ Data data = createData();
+ if (objectArray != null) {
+ Zipper2 zipper2 = new Zipper2(objectArray);
+ restoreData(data, zipper2);
}
-
- protected Data createData() {
- return new Data();
+
+ return data;
+ }
+
+ protected Data createData() {
+ return new Data();
+ }
+
+ private Integer decodeColor(String value) {
+ if (value !=null && value.length() != 0) {
+ return Integer.valueOf(HtmlColor.decode(value).getRGB());
+ } else {
+ return null;
}
-
- private void saveData(FacesContext context, Data data, String baseColor, String gradientColor) {
- Integer headerBackgroundColor = getColorValueParameter(context, baseColor, false);
- Integer headerGradientColor = getColorValueParameter(context, gradientColor, false);
+ }
- if (!(headerBackgroundColor == null && headerGradientColor == null)) {
- if (headerBackgroundColor == null) {
- headerBackgroundColor = getColorValueParameter(context, baseColor, true);
- }
+ private void saveData(FacesContext context, Data data, String baseColor, String gradientColor, Object parameterData) {
+ Integer baseIntColor = null;
+ Integer headerIntColor = null;
+ String gradientTypeString = null;
+ String alignmentString = null;
- if (headerGradientColor == null) {
- headerGradientColor = getColorValueParameter(context, gradientColor, true);
- }
- }
+ if (parameterData instanceof Map<?, ?>) {
+ Map<?, ?> map = (Map<?, ?>) parameterData;
- data.setHeaderBackgroundColor(headerBackgroundColor);
- data.setHeaderGradientColor(headerGradientColor);
- data.setGradientType(GradientType.getBySkinParameter(getValueParameter(context, Skin.gradientType)));
+ gradientTypeString = (String) map.get(Skin.gradientType);
+ alignmentString = (String) map.get("valign");
+ baseIntColor = decodeColor((String) map.get("baseColor"));
+ headerIntColor = decodeColor((String) map.get("gradientColor"));
}
-
- protected void saveData(FacesContext context, Data data) {
- if (baseColor == null) {
- saveData(context, data, Skin.headerBackgroundColor, "headerGradientColor");
- } else {
- saveData(context, data, baseColor, gradientColor);
- }
+
+ if (baseIntColor == null) {
+ baseIntColor = getColorValueParameter(context, baseColor, false);
}
-
- protected Object getDataToStore(FacesContext context, Object data) {
- Data dataObject = createData();
- saveData(context, dataObject);
-
- return dataObject.toByteArray();
+
+ if (headerIntColor == null) {
+ headerIntColor = getColorValueParameter(context, gradientColor, false);
}
-
- public boolean isCacheable() {
- return true;
- }
-
- protected String getValueParameter(FacesContext context, String name) {
- SkinFactory skinFactory = SkinFactory.getInstance();
+ if (!(baseIntColor == null && headerIntColor == null)) {
+ if (baseIntColor == null) {
+ baseIntColor = getColorValueParameter(context, baseColor, true);
+ }
- Skin skin = skinFactory.getSkin(context);
- String value = (String) skin.getParameter(context, name);
-
- if (value == null || value.length() == 0) {
- skin = skinFactory.getDefaultSkin(context);
- value = (String) skin.getParameter(context, name);
+ if (headerIntColor == null) {
+ headerIntColor = getColorValueParameter(context, gradientColor, true);
}
-
- return value;
}
- protected Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
- Skin skin;
- if (useDefault) {
- skin = SkinFactory.getInstance().getDefaultSkin(context);
- } else {
- skin = SkinFactory.getInstance().getSkin(context);
- }
-
- String tmp = (String) skin.getParameter(context,name);
- if (tmp!=null && tmp.length() != 0) {
- return new Integer(HtmlColor.decode(tmp).getRGB());
- } else {
- return null;
- }
+ data.setHeaderBackgroundColor(baseIntColor);
+ data.setHeaderGradientColor(headerIntColor);
+
+ if (gradientTypeString == null || gradientTypeString.length() == 0) {
+ gradientTypeString = getValueParameter(context, Skin.gradientType);
}
- protected static class Data implements Serializable {
- public Data() {
- }
+ data.setGradientType(GradientType.getBySkinParameter(gradientTypeString));
+ data.setGradientAlignment(GradientAlignment.getByParameter(alignmentString));
+ }
- /**
- *
- */
- private static final long serialVersionUID = 1732700513743861250L;
- private Integer headerBackgroundColor;
- private Integer headerGradientColor;
- private GradientType gradientType;
-
- public byte[] toByteArray() {
- if (headerBackgroundColor != null && headerGradientColor != null && gradientType != null) {
- byte[] ret = new byte[7];
- new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue()).
- addByte((byte) gradientType.ordinal());
- return ret;
- } else {
- return null;
- }
- }
+ protected void saveData(FacesContext context, Data data, Object parameterData) {
+ if (baseColor == null) {
+ saveData(context, data, Skin.headerBackgroundColor, "headerGradientColor", parameterData);
+ } else {
+ saveData(context, data, baseColor, gradientColor, parameterData);
+ }
+ }
- public Integer getHeaderBackgroundColor() {
- return headerBackgroundColor;
- }
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Data dataObject = createData();
+ saveData(context, dataObject, data);
- public void setHeaderBackgroundColor(Integer headerBackgroundColor) {
- this.headerBackgroundColor = headerBackgroundColor;
- }
+ return dataObject.toByteArray();
+ }
- public Integer getHeaderGradientColor() {
- return headerGradientColor;
- }
+ public boolean isCacheable() {
+ return true;
+ }
- public void setHeaderGradientColor(Integer headerGradientColor) {
- this.headerGradientColor = headerGradientColor;
- }
- public GradientType getGradientType() {
- return gradientType;
- }
+ protected String getValueParameter(FacesContext context, String name) {
+ SkinFactory skinFactory = SkinFactory.getInstance();
- public void setGradientType(GradientType gradientType) {
- this.gradientType = gradientType;
- }
-
+ Skin skin = skinFactory.getSkin(context);
+ String value = (String) skin.getParameter(context, name);
+
+ if (value == null || value.length() == 0) {
+ skin = skinFactory.getDefaultSkin(context);
+ value = (String) skin.getParameter(context, name);
}
+ return value;
+ }
+
+ protected Integer getColorValueParameter(FacesContext context, String name, boolean useDefault) {
+ Skin skin;
+ if (useDefault) {
+ skin = SkinFactory.getInstance().getDefaultSkin(context);
+ } else {
+ skin = SkinFactory.getInstance().getSkin(context);
+ }
+
+ return decodeColor((String) skin.getParameter(context,name));
+ }
+
+ protected static class Data implements Serializable {
+ public Data() {
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1732700513743861250L;
+ private Integer headerBackgroundColor;
+ private Integer headerGradientColor;
+ private GradientType gradientType;
+ private GradientAlignment gradientAlignment;
+
+ public byte[] toByteArray() {
+ if (headerBackgroundColor != null && headerGradientColor != null && gradientType != null) {
+ byte[] ret = new byte[8];
+ new Zipper2(ret).addColor(headerBackgroundColor.intValue()).addColor(headerGradientColor.intValue()).
+ addByte((byte) gradientType.ordinal()).addByte((byte) gradientAlignment.ordinal());
+ return ret;
+ } else {
+ return null;
+ }
+ }
+
+ public Integer getHeaderBackgroundColor() {
+ return headerBackgroundColor;
+ }
+
+ public void setHeaderBackgroundColor(Integer headerBackgroundColor) {
+ this.headerBackgroundColor = headerBackgroundColor;
+ }
+
+ public Integer getHeaderGradientColor() {
+ return headerGradientColor;
+ }
+
+ public void setHeaderGradientColor(Integer headerGradientColor) {
+ this.headerGradientColor = headerGradientColor;
+ }
+
+ public GradientType getGradientType() {
+ return gradientType;
+ }
+
+ public void setGradientType(GradientType gradientType) {
+ this.gradientType = gradientType;
+ }
+
+ public GradientAlignment getGradientAlignment() {
+ return gradientAlignment;
+ }
+
+ public void setGradientAlignment(GradientAlignment gradientAlignment) {
+ this.gradientAlignment = gradientAlignment;
+ }
+
+ }
+
}
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2008-04-22 16:58:34 UTC (rev 8077)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2008-04-22 17:21:16 UTC (rev 8078)
@@ -87,8 +87,8 @@
}
@Override
- protected void saveData(FacesContext context, org.richfaces.renderkit.html.BaseGradient.Data data) {
- super.saveData(context, data);
+ protected void saveData(FacesContext context, org.richfaces.renderkit.html.BaseGradient.Data data, Object parameterData) {
+ super.saveData(context, data, parameterData);
((Data) data).setHeight(getHeight(context));
}
@@ -125,13 +125,5 @@
this.height = height;
}
- public GradientType getGradientType() {
- return GradientType.PLAIN;
- }
-
- public void setGradientType(GradientType gradientType) {
- //does nothing
- }
-
};
}
Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/GradientAlignment.java 2008-04-22 17:21:16 UTC (rev 8078)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+
+
+/**
+ * Created 22.04.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public enum GradientAlignment {
+ TOP {
+ @Override
+ public int getBottomRectangleHeight(int imageHeight, int gradientHeight) {
+ return imageHeight - gradientHeight;
+ }
+
+ @Override
+ public int getTopRectangleHeight(int imageHeight, int gradientHeight) {
+ return 0;
+ }
+ },
+
+ CENTER {
+ @Override
+ public int getBottomRectangleHeight(int imageHeight, int gradientHeight) {
+ return (imageHeight - gradientHeight) / 2;
+ }
+
+ @Override
+ public int getTopRectangleHeight(int imageHeight, int gradientHeight) {
+ return getBottomRectangleHeight(imageHeight, gradientHeight);
+ }
+ },
+
+ BOTTOM {
+ @Override
+ public int getBottomRectangleHeight(int imageHeight, int gradientHeight) {
+ return 0;
+ }
+
+ @Override
+ public int getTopRectangleHeight(int imageHeight, int gradientHeight) {
+ return imageHeight - gradientHeight;
+ }
+ };
+
+ public static final GradientAlignment getByParameter(String string) {
+ if (string == null || string.length() == 0) {
+ return TOP;
+ }
+
+ return GradientAlignment.valueOf(string.toUpperCase());
+ }
+
+ public abstract int getTopRectangleHeight(int imageHeight, int gradientHeight);
+
+ public abstract int getBottomRectangleHeight(int imageHeight, int gradientHeight);
+
+
+
+}
Modified: trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2008-04-22 16:58:34 UTC (rev 8077)
+++ trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2008-04-22 17:21:16 UTC (rev 8078)
@@ -29,6 +29,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -248,6 +249,38 @@
}
}
+ private void processProperties(Map<Object, Object> properties) {
+ // replace all EL-expressions by prepared ValueBinding ?
+ ApplicationFactory factory = (ApplicationFactory) FactoryFinder
+ .getFactory(FactoryFinder.APPLICATION_FACTORY);
+ Application app = factory.getApplication();
+
+ for (Entry<Object, Object> entry : properties.entrySet()) {
+ String propertyName = (String) entry.getKey();
+ Object propertyObject = entry.getValue();
+ if (propertyObject instanceof String) {
+ String property = (String) propertyObject;
+ int count = 0;
+ while (property.startsWith("&")) {
+ property = (String) properties.get(property.substring(1));
+ if (null == property) {
+ throw new FacesException(Messages.getMessage(
+ Messages.SKIN_ILLEGAL_REFERENCE, propertyName));
+ }
+ if (count++ > 1000) {
+ throw new FacesException(Messages.getMessage(
+ Messages.SKIN_CYCLIC_REFERENCE, propertyName));
+ }
+ }
+ if (ELUtils.isValueReference(property)) {
+ entry.setValue(app.createValueBinding(property));
+ } else {
+ entry.setValue(property);
+ }
+ }
+ }
+ }
+
/**
* Factory method for build skin from properties files. for given skin name,
* search in classpath all resources with name 'name'.skin.properties and
@@ -264,8 +297,37 @@
*/
protected Skin buildSkin(String name, Properties defaultProperties)
throws SkinNotFoundException {
- Map skinParams = loadProperties(name, defaultProperties, SKINS_PATHS);
- return new SkinImpl(skinParams);
+
+ String baseSkinName = name;
+ int counter = 0;
+
+ Map<Object, Object> result = new HashMap<Object, Object>();
+ do {
+ Map<Object, Object> skinParams = loadProperties(baseSkinName, SKINS_PATHS);
+ for (Entry<Object, Object> entry : skinParams.entrySet()) {
+ Object key = entry.getKey();
+ if (!result.containsKey(key)) {
+ result.put(key, entry.getValue());
+ }
+ }
+
+ baseSkinName = (String) skinParams.get(Skin.baseSkin);
+
+ if (counter++ > 1000) {
+ throw new IllegalStateException("Cyclic base skin!");
+ }
+
+ } while (baseSkinName != null);
+
+ for (Entry<Object, Object> entry : defaultProperties.entrySet()) {
+ if (!result.containsKey(entry.getKey())) {
+ result.put(entry.getKey(), entry.getValue());
+ }
+ }
+
+ processProperties(result);
+
+ return new SkinImpl(result);
}
/**
@@ -276,12 +338,11 @@
* @throws FacesException
* @throws ReferenceSyntaxException
*/
- protected Map loadProperties(String name, Properties defaultProperties,
- String[] paths) throws SkinNotFoundException, FacesException,
+ protected Map loadProperties(String name, String[] paths) throws SkinNotFoundException, FacesException,
ReferenceSyntaxException {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
// Get properties for concrete skin.
- Properties skinProperties = new Properties(defaultProperties);
+ Properties skinProperties = new Properties();
int loadedPropertiesCount = 0;
for (int i = 0; i < paths.length; i++) {
try {
@@ -320,38 +381,7 @@
throw new SkinNotFoundException(Messages.getMessage(
Messages.SKIN_NOT_FOUND_ERROR, name));
}
- // replace all EL-expressions by prepared ValueBinding ?
- ApplicationFactory factory = (ApplicationFactory) FactoryFinder
- .getFactory(FactoryFinder.APPLICATION_FACTORY);
- Application app = factory.getApplication();
- Map skinParams = new HashMap();
- for (Enumeration e = skinProperties.propertyNames(); e
- .hasMoreElements();) {
- String propertyName = (String) e.nextElement();
- String property = skinProperties.getProperty(propertyName);
- if (null != property) {
- int count = 0;
- while (property.startsWith("&")) {
- property = skinProperties
- .getProperty(property.substring(1));
- if (null == property) {
- throw new FacesException(Messages.getMessage(
- Messages.SKIN_ILLEGAL_REFERENCE, propertyName));
- }
- if (count++ > 1000) {
- throw new FacesException(Messages.getMessage(
- Messages.SKIN_CYCLIC_REFERENCE, propertyName));
- }
- }
- if (ELUtils.isValueReference(property)) {
- skinParams.put(propertyName, app
- .createValueBinding(property));
- } else {
- skinParams.put(propertyName, property);
- }
- }
- }
- return skinParams;
+ return skinProperties;
}
}
16 years, 8 months
JBoss Rich Faces SVN: r8077 - trunk/framework/api/src/main/java/org/richfaces/skin.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-22 12:58:34 -0400 (Tue, 22 Apr 2008)
New Revision: 8077
Modified:
trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java
Log:
Skin.baseSkin constant added
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java 2008-04-22 16:04:55 UTC (rev 8076)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/Skin.java 2008-04-22 16:58:34 UTC (rev 8077)
@@ -253,6 +253,8 @@
public static final String gradientType = "gradientType";
+ public static final String baseSkin = "baseSkin";
+
// Preferable parameters
/**
* Preferable parameters names for skin ( in common, for Preferable.Name
16 years, 8 months
JBoss Rich Faces SVN: r8076 - trunk/test-applications/jsp/src/main/webapp/pages/Action.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-22 12:04:55 -0400 (Tue, 22 Apr 2008)
New Revision: 8076
Modified:
trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
Log:
Add events
Modified: trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-04-22 16:04:41 UTC (rev 8075)
+++ trunk/test-applications/jsp/src/main/webapp/pages/Action/EventInfo.jsp 2008-04-22 16:04:55 UTC (rev 8076)
@@ -4,6 +4,18 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="EventInfoSubview">
+ <f:verbatim><div style="position: relative"><input id="oneditactivatedInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oneditactivationInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputdblclickInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputmousedownInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputmousemoveInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputmouseoutInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputmouseoverInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="oninputmouseupInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onviewactivatedInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+ <f:verbatim><div style="position: relative"><input id="onviewactivationInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
+
+
<f:verbatim><div style="position: relative"><input id="onmouseupInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="ontabenterInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
<f:verbatim><div style="position: relative"><input id="ontableaveInputID" type="hidden" value="don't work!" size="42" /></div></f:verbatim>
16 years, 8 months
JBoss Rich Faces SVN: r8075 - trunk/test-applications/jsp/src/main/java/util/event.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-22 12:04:41 -0400 (Tue, 22 Apr 2008)
New Revision: 8075
Modified:
trunk/test-applications/jsp/src/main/java/util/event/Event.java
Log:
Add events
Modified: trunk/test-applications/jsp/src/main/java/util/event/Event.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-04-22 15:52:48 UTC (rev 8074)
+++ trunk/test-applications/jsp/src/main/java/util/event/Event.java 2008-04-22 16:04:41 UTC (rev 8075)
@@ -93,6 +93,16 @@
private String oncontextmenu;
private String ongroupcollapse;
private String onSlideSubmit;
+ private String oneditactivated;
+ private String oneditactivation;
+ private String oninputdblclick;
+ private String oninputmousedown;
+ private String oninputmousemove;
+ private String oninputmouseout;
+ private String oninputmouseover;
+ private String oninputmouseup;
+ private String onviewactivated;
+ private String onviewactivation;
// showEvent('onkeypressInputID', 'onkeypress work!')
public Event() {
@@ -182,6 +192,16 @@
onupclick = "showEvent('onupclickInputID', 'onupclick work!')";
ongroupcollapse = "showEvent('ongroupcollapseInputID', 'ongroupcollapse work!')";
onSlideSubmit = "showEvent('onSlideSubmitInputID', 'onSlideSubmit work!')";
+ oneditactivated = "showEvent('oneditactivatedInputID', 'oneditactivated work!')";
+ oneditactivation = "showEvent('oneditactivationInputID', 'oneditactivation work!')";
+ oninputdblclick = "showEvent('oninputdblclickInputID', 'oninputdblclick work!')";
+ oninputmousedown = "showEvent('oninputmousedownInputID', 'oninputmousedown work!')";
+ oninputmousemove = "showEvent('oninputmousemoveInputID', 'oninputmousemove work!')";
+ oninputmouseout = "showEvent('oninputmouseoutInputID', 'oninputmouseout work!')";
+ oninputmouseover = "showEvent('oninputmouseoverInputID', 'oninputmouseover work!')";
+ oninputmouseup = "showEvent('oninputmouseupInputID', 'oninputmouseup work!')";
+ onviewactivated = "showEvent('onviewactivatedInputID', 'onviewactivated work!')";
+ onviewactivation = "showEvent('onviewactivationInputID', 'onviewactivation work!')";
}
public String getOncontextmenu() {
@@ -1072,4 +1092,84 @@
this.onSlideSubmit = onSlideSubmit;
}
+ public String getOninputmousedown() {
+ return oninputmousedown;
+ }
+
+ public void setOninputmousedown(String oninputmousedown) {
+ this.oninputmousedown = oninputmousedown;
+ }
+
+ public String getOninputmousemove() {
+ return oninputmousemove;
+ }
+
+ public void setOninputmousemove(String oninputmousemove) {
+ this.oninputmousemove = oninputmousemove;
+ }
+
+ public String getOninputmouseout() {
+ return oninputmouseout;
+ }
+
+ public void setOninputmouseout(String oninputmouseout) {
+ this.oninputmouseout = oninputmouseout;
+ }
+
+ public String getOninputmouseover() {
+ return oninputmouseover;
+ }
+
+ public void setOninputmouseover(String oninputmouseover) {
+ this.oninputmouseover = oninputmouseover;
+ }
+
+ public String getOninputmouseup() {
+ return oninputmouseup;
+ }
+
+ public void setOninputmouseup(String oninputmouseup) {
+ this.oninputmouseup = oninputmouseup;
+ }
+
+ public String getOnviewactivated() {
+ return onviewactivated;
+ }
+
+ public void setOnviewactivated(String onviewactivated) {
+ this.onviewactivated = onviewactivated;
+ }
+
+ public String getOnviewactivation() {
+ return onviewactivation;
+ }
+
+ public void setOnviewactivation(String onviewactivation) {
+ this.onviewactivation = onviewactivation;
+ }
+
+ public String getOneditactivated() {
+ return oneditactivated;
+ }
+
+ public void setOneditactivated(String oneditactivated) {
+ this.oneditactivated = oneditactivated;
+ }
+
+ public String getOneditactivation() {
+ return oneditactivation;
+ }
+
+ public void setOneditactivation(String oneditactivation) {
+ this.oneditactivation = oneditactivation;
+ }
+
+ public String getOninputdblclick() {
+ return oninputdblclick;
+ }
+
+ public void setOninputdblclick(String oninputdblclick) {
+ this.oninputdblclick = oninputdblclick;
+ }
+
}
\ No newline at end of file
16 years, 8 months
JBoss Rich Faces SVN: r8074 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/panelBar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-04-22 11:52:48 -0400 (Tue, 22 Apr 2008)
New Revision: 8074
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/
trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
Log:
Selenium tests for panel bar.
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarDescription.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarDescription.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarDescription.xhtml 2008-04-22 15:52:48 UTC (rev 8074)
@@ -0,0 +1,5 @@
+<html>
+<table border="1" style="border-color: #F1EEE9" cellpadding="5" cellspacing="0">
+
+</table>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/panelBar/panelBarTest.xhtml 2008-04-22 15:52:48 UTC (rev 8074)
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="../../layout/template.xhtml">
+ <ui:define name="style">
+ .link {margin: 0px 5px}
+ </ui:define>
+ <ui:define name="component">
+ <rich:panelBar id="panelBar" width="300" height="300" >
+ <rich:panelBarItem id="item1" >
+ <f:facet name="label">
+ <h:outputText value="1" id="label1" />
+ </f:facet>
+ <h:outputText id="output1" value="Item 1" />
+ </rich:panelBarItem>
+ <rich:panelBarItem id="item2">
+ <f:facet name="label">
+ <h:outputText value="2" id="label2" />
+ </f:facet>
+ <h:outputText id="output2" value="Item 2" />
+ </rich:panelBarItem>
+ <rich:panelBarItem id="item3" >
+ <f:facet name="label">
+ <h:outputText value="3" id="label3" />
+ </f:facet>
+ <h:outputText id="output3" value="Item 3" />
+ </rich:panelBarItem>
+ </rich:panelBar>
+
+ <br/>
+ <h:commandButton id="button_simple" value="Submit" />
+ <a4j:commandButton id="button_ajax" value="Submit" reRender="panelBar" />
+ <br/>
+ </ui:define>
+ <ui:define name="description">
+ <ui:include src="panelBarDescription.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/PanelBarTest.java 2008-04-22 15:52:48 UTC (rev 8074)
@@ -0,0 +1,98 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class PanelBarTest extends SeleniumTestBase implements RichSeleniumTest {
+
+
+ public PanelBarTest() {
+ super("http", "localhost", "8080");
+ }
+
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testPanelBarComponent() throws Exception {
+ renderPage("/faces/pages/panelBar/panelBarTest.xhtml");
+
+ _testPanelBarComponent(COMPONENT_PREFIX_INSIDE_PANEL);
+ _testPanelBarComponent(COMPONENT_PREFIX_INSIDE_TABLE);
+ }
+
+ private void _testPanelBarComponent(String parentId) {
+ String label2 = parentId + "label2";
+ String label3 = parentId + "label3";
+
+ String output1 = parentId + "output1";
+ String output2 = parentId + "output2";
+ String output3 = parentId + "output3";
+
+ String ajaxButton = parentId + "button_ajax";
+ String simpleButton = parentId + "button_simple";
+
+ clickById(label2);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickById(simpleButton);
+ waitForPageToLoad();
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertTrue(isVisibleById(output2));
+ Assert.assertFalse(isVisibleById(output3));
+
+ clickById(label3);
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+
+ clickById(ajaxButton);
+ waitForAjaxCompletion();
+ Assert.assertFalse(isVisibleById(output1));
+ Assert.assertFalse(isVisibleById(output2));
+ Assert.assertTrue(isVisibleById(output3));
+ }
+}
16 years, 8 months
JBoss Rich Faces SVN: r8073 - trunk/ui/calendar/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-04-22 11:41:05 -0400 (Tue, 22 Apr 2008)
New Revision: 8073
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
Log:
http://jira.jboss.com/jira/browse/RF-3105
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-04-22 15:17:58 UTC (rev 8072)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-04-22 15:41:05 UTC (rev 8073)
@@ -77,6 +77,11 @@
private static String DEFAULT_TIME_VALUE = "hours:12,minutes:0";
/**
+ * Default pattern for defaultTime
+ */
+ private static String DEFAULT_TIME_PATTERN = "HH:mm";
+
+ /**
* Constant "hours"
*/
private static String HOURS_VALUE = "hours";
@@ -288,7 +293,7 @@
Pattern pattern = Pattern.compile(timePattern);
Matcher matcher = pattern.matcher(datePattern);
- String subTimePattern = null;
+ String subTimePattern = DEFAULT_TIME_PATTERN;
if(matcher.find()) {
subTimePattern = matcher.group().trim();
}
16 years, 8 months
JBoss Rich Faces SVN: r8072 - trunk/ui/pickList/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-22 11:17:58 -0400 (Tue, 22 Apr 2008)
New Revision: 8072
Modified:
trunk/ui/pickList/src/main/config/component/picklist.xml
Log:
http://jira.jboss.com/jira/browse/RF-3093?page=all
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-04-22 15:07:28 UTC (rev 8071)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-04-22 15:17:58 UTC (rev 8072)
@@ -180,8 +180,13 @@
<classname>java.lang.String</classname>
<description>A JavaScript event handler called on a list change operation</description>
</property>
-
- <property hidden="true">
+
+ &ui_input_attributes;
+ &html_universal_attributes;
+ &html_events;
+ &html_control_events;
+
+ <property hidden="true">
<name>valid </name>
<classname>boolean</classname>
</property>
@@ -194,12 +199,18 @@
<property hidden="true">
<name>localValueSet </name>
<classname>boolean</classname>
- </property>
+ </property>
- &ui_input_attributes;
- &html_universal_attributes;
- &html_events;
- &html_control_events;
+ <property hidden="true">
+ <name>dir</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ </property>
+
+ <property hidden="true">
+ <name>size</name>
+ <classname>int</classname>
+ </property>
</properties>
16 years, 8 months
JBoss Rich Faces SVN: r8071 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-22 11:07:28 -0400 (Tue, 22 Apr 2008)
New Revision: 8071
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
Log:
http://jira.jboss.com/jira/browse/RF-2657
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-04-22 14:56:39 UTC (rev 8070)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss 2008-04-22 15:07:28 UTC (rev 8071)
@@ -93,6 +93,7 @@
border : 1px solid #4a75b5;
background-color: #4a75b5;
cursor:pointer;
+ width:100%;
}
.rich-combobox-strut {
16 years, 8 months