Author: abelevich
Date: 2010-11-15 05:55:11 -0500 (Mon, 15 Nov 2010)
New Revision: 20044
Added:
sandbox/trunk/ui/toolbar/
sandbox/trunk/ui/toolbar/pom.xml
sandbox/trunk/ui/toolbar/ui/
sandbox/trunk/ui/toolbar/ui/pom.xml
sandbox/trunk/ui/toolbar/ui/src/
sandbox/trunk/ui/toolbar/ui/src/main/
sandbox/trunk/ui/toolbar/ui/src/main/java/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/package-info.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
sandbox/trunk/ui/toolbar/ui/src/main/resources/
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/org.richfaces/
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss
sandbox/trunk/ui/toolbar/ui/src/main/templates/
sandbox/trunk/ui/toolbar/ui/src/main/templates/toolBar.template.xml
Log:
initial commit
Added: sandbox/trunk/ui/toolbar/pom.xml
===================================================================
--- sandbox/trunk/ui/toolbar/pom.xml (rev 0)
+++ sandbox/trunk/ui/toolbar/pom.xml 2010-11-15 10:55:11 UTC (rev 20044)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software 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 software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+
http://www.fsf.org.
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-root-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: Output Aggregator</name>
+
+ <modules>
+ <module>ui</module>
+ </modules>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/o...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trun...
+ <
url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+</project>
\ No newline at end of file
Added: sandbox/trunk/ui/toolbar/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/toolbar/ui/pom.xml (rev 0)
+++ sandbox/trunk/ui/toolbar/ui/pom.xml 2010-11-15 10:55:11 UTC (rev 20044)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ JBoss, Home of Professional Open Source Copyright 2010, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of
+ individual contributors. This is free software; you can
+ redistribute it and/or modify it under the terms of the GNU
+ Lesser General Public License as published by the Free Software
+ Foundation; either version 2.1 of the License, or (at your
+ option) any later version. This software 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 software; if not,
+ write to the Free Software Foundation, Inc., 51 Franklin St,
+ Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site:
+
http://www.fsf.org.
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-ui</artifactId>
+ <name>Richfaces UI Components: Output UI</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+
<suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.common</groupId>
+ <artifactId>richfaces-ui-common-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/o...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trun...
+ <
url>http://fisheye.jboss.org/browse/richfaces</url>
+ </scm>
+
+</project>
\ No newline at end of file
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBar.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,60 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.ToolBarRendererBase;
+
+@JsfComponent(family = AbstractToolBar.COMPONENT_FAMILY, type =
AbstractToolBar.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = ToolBarRendererBase.RENDERER_TYPE), tag =
@Tag(name="toolBar")
+)
+public abstract class AbstractToolBar extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ToolBar";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.ToolBar";
+
+ @Attribute
+ public abstract String getHeight();
+
+ @Attribute
+ public abstract String getWidth();
+
+ @Attribute
+ public abstract String getItemSeparator();
+
+ @Attribute(events=@EventName("itemclick"))
+ public abstract String getOnitemclick();
+
+ @Attribute(events=@EventName("itemdblclick"))
+ public abstract String getOnitemdblclick();
+
+ @Attribute(events=@EventName("itemmousedown"))
+ public abstract String getOnitemmousedown();
+
+ @Attribute(events=@EventName("itemmouseup"))
+ public abstract String getOnitemmouseup();
+
+ @Attribute(events=@EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events=@EventName("itemmousemove"))
+ public abstract String getOnitemmousemove();
+
+ @Attribute(events=@EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events=@EventName("itemkeypress"))
+ public abstract String getOnitemkeypress();
+
+ @Attribute(events=@EventName("itemkeydown"))
+ public abstract String getOnitemkeydown();
+
+ @Attribute(events=@EventName("itemkeyup"))
+ public abstract String getOnitemkeyup();
+
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,84 @@
+package org.richfaces.component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.renderkit.html.ToolBarGroupRenderer;
+
+@JsfComponent(family = AbstractToolBar.COMPONENT_FAMILY, type =
AbstractToolBarGroup.COMPONENT_TYPE,
+ renderer=@JsfRenderer(type = ToolBarGroupRenderer.RENDERER_TYPE), tag =
@Tag(name="toolBarGroup"))
+public abstract class AbstractToolBarGroup extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.ToolBarGroup";
+
+ @Attribute
+ public abstract String getItemSeparator();
+
+ @Attribute
+ public abstract String getLocation();
+
+ @Attribute(events=@EventName("itemclick"))
+ public abstract String getOnitemclick();
+
+ @Attribute(events=@EventName("itemdblclick"))
+ public abstract String getOnitemdblclick();
+
+ @Attribute(events=@EventName("itemmousedown"))
+ public abstract String getOnitemmousedown();
+
+ @Attribute(events=@EventName("itemmouseup"))
+ public abstract String getOnitemmouseup();
+
+ @Attribute(events=@EventName("itemmouseover"))
+ public abstract String getOnitemmouseover();
+
+ @Attribute(events=@EventName("itemmousemove"))
+ public abstract String getOnitemmousemove();
+
+ @Attribute(events=@EventName("itemmouseout"))
+ public abstract String getOnitemmouseout();
+
+ @Attribute(events=@EventName("itemkeypress"))
+ public abstract String getOnitemkeypress();
+
+ @Attribute(events=@EventName("itemkeydown"))
+ public abstract String getOnitemkeydown();
+
+ @Attribute(events=@EventName("itemkeyup"))
+ public abstract String getOnitemkeyup();
+
+ public AbstractToolBar getToolBar() {
+ UIComponent component = this.getParent();
+ if (component == null) {
+ throw new FacesException("The component: " +
this.getClientId(getFacesContext()) +
+ " is not nested within " +
AbstractToolBar.class.getSimpleName());
+ } else if (!(component instanceof AbstractToolBar)) {
+ throw new FacesException("The component: " +
this.getClientId(getFacesContext()) +
+ " is not a direct child of " +
AbstractToolBar.class.getSimpleName());
+ }
+ return (AbstractToolBar) component;
+ }
+
+ public List<UIComponent> getRenderedChildren() {
+ List<UIComponent> children = this.getChildren();
+ List<UIComponent> renderedChildren = new
ArrayList<UIComponent>(children.size());
+
+ for (UIComponent child : children) {
+ if (child.isRendered()) {
+ renderedChildren.add(child);
+ }
+ }
+
+ return renderedChildren;
+ }
+
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/package-info.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/component/package-info.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+@org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/toolBar",
shortName="toolBar")
+package org.richfaces.component;
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,99 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.component.AbstractToolBar;
+import org.richfaces.component.AbstractToolBarGroup;
+import org.richfaces.renderkit.HtmlConstants;
+
+@JsfRenderer(type = ToolBarGroupRenderer.RENDERER_TYPE, family =
AbstractToolBar.COMPONENT_FAMILY)
+public class ToolBarGroupRenderer extends ToolBarRendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.ToolBarGroupRenderer";
+
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractToolBarGroup.class;
+ }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ public void encodeChildren(FacesContext facesContext, UIComponent component) throws
IOException {
+ AbstractToolBarGroup toolBarGroup = (AbstractToolBarGroup) component;
+ List<UIComponent> renderedChildren = toolBarGroup.getRenderedChildren();
+ if (renderedChildren.size() <= 0) {
+ return;
+ }
+
+ ResponseWriter writer = facesContext.getResponseWriter();
+ renderChild(facesContext, toolBarGroup, writer, renderedChildren.get(0));
+ for (int i = 1; i < renderedChildren.size(); i++) {
+ insertSeparatorIfNeed(facesContext, toolBarGroup, writer);
+ renderChild(facesContext, toolBarGroup, writer, renderedChildren.get(i));
+ }
+ }
+
+ private void renderChild(FacesContext facesContext, AbstractToolBarGroup
toolBarGroup, ResponseWriter writer,
+ UIComponent child) throws IOException {
+ writer.startElement(HtmlConstants.TD_ELEM, toolBarGroup);
+ writeClassValue(toolBarGroup, writer);
+ writeStyleValue(toolBarGroup, writer);
+ encodeEventsAttributes(facesContext, toolBarGroup);
+ child.encodeAll(facesContext);
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+
+ private void writeStyleValue(AbstractToolBarGroup toolBarGroup, ResponseWriter
writer) throws IOException {
+ String style = getStringAttribute(toolBarGroup, HtmlConstants.STYLE_ATTRIBUTE);
+ String contentStyle = getStringAttribute(getParentToolBar(toolBarGroup),
"contentStyle");
+
+ String value = getCompoundStyleValue(contentStyle, style);
+
+ if (isPropertyRendered(value)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, value, null);
+ }
+ }
+
+ private String getCompoundStyleValue(String... styles) {
+ if (styles != null) {
+ StringBuilder result = new StringBuilder();
+ for (int styleIndex = 0; styleIndex < styles.length; styleIndex++) {
+ result.append(styles[styleIndex]);
+ if (styleIndex != styles.length - 1) {
+ result.append("; ");
+ }
+ }
+ return result.toString();
+ }
+ return "";
+ }
+
+ private void writeClassValue(AbstractToolBarGroup toolBarGroup, ResponseWriter
writer) throws IOException {
+ String styleClass = getStringAttribute(toolBarGroup,
HtmlConstants.STYLE_CLASS_ATTR);
+ AbstractToolBar toolBar = getParentToolBar(toolBarGroup);
+ String contentClass = null;
+
+ if(toolBar != null) {
+ contentClass = getStringAttribute(toolBar, "contentClass");
+ }
+
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
concatClasses("rf-tb-itm", contentClass, styleClass), null);
+ }
+
+ private String getStringAttribute(UIComponent toolBarGroup, String attribute) {
+ String value = (String) toolBarGroup.getAttributes().get(attribute);
+ return null == value ? "" : value;
+ }
+
+ public AbstractToolBar getParentToolBar(UIComponent component) {
+ return (component instanceof AbstractToolBarGroup) ? ((AbstractToolBarGroup)
component).getToolBar() : null;
+ }
+
+}
\ No newline at end of file
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,254 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.richfaces.component.AbstractToolBar;
+import org.richfaces.component.AbstractToolBarGroup;
+import org.richfaces.component.util.ViewUtil;
+import org.richfaces.renderkit.ComponentAttribute;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
+import org.richfaces.renderkit.RendererBase;
+
+
+@ResourceDependency(library = "org.richfaces", name =
"toolBar.ecss")
+public abstract class ToolBarRendererBase extends RendererBase {
+
+ public static final String RENDERER_TYPE =
"org.richfaces.ToolBarRenderer";
+
+ public static final Map<String, ComponentAttribute> ITEMS_HANDLER_ATTRIBUTES =
Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
+ .setEventNames("itemclick")
+ .setComponentAttributeName("onitemclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE)
+ .setEventNames("itemdblclick")
+ .setComponentAttributeName("onitemdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE)
+ .setEventNames("itemmousedown")
+ .setComponentAttributeName("onitemmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE)
+ .setEventNames("itemmouseup")
+ .setComponentAttributeName("onitemmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE)
+ .setEventNames("itemmouseover")
+ .setComponentAttributeName("onitemmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE)
+ .setEventNames("itemmousemove")
+ .setComponentAttributeName("onitemmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE)
+ .setEventNames("itemmouseout")
+ .setComponentAttributeName("onitemmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE)
+ .setEventNames("itemkeypress")
+ .setComponentAttributeName("onitemkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE)
+ .setEventNames("itemkeydown")
+ .setComponentAttributeName("onitemkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
+ .setEventNames("itemkeyup")
+ .setComponentAttributeName("onitemkeyup")
+ ));
+
+ public enum ItemSeparators {
+ NONE, SQUARE, DISC, GRID, LINE
+ }
+
+ public enum Locations {
+ RIGHT, LEFT
+ }
+
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component) throws
IOException {
+ AbstractToolBar toolBar = (AbstractToolBar) component;
+ String contentClass = (String)
toolBar.getAttributes().get("contentClass");
+ String contentStyle = (String)
toolBar.getAttributes().get("contentStyle");
+
+ List<UIComponent> children = toolBar.getChildren();
+
+ if (children != null) {
+ List<UIComponent> childrenToTheLeft = new
LinkedList<UIComponent>();
+ List<UIComponent> childrenToTheRight = new
LinkedList<UIComponent>();
+ for (UIComponent child : children) {
+ if (child.isRendered()) {
+ if (child instanceof AbstractToolBarGroup) {
+ AbstractToolBarGroup group = (AbstractToolBarGroup) child;
+ String location = group.getLocation();
+ if (location != null &&
location.equalsIgnoreCase(Locations.RIGHT.toString())) {
+ childrenToTheRight.add(child);
+ } else {
+ childrenToTheLeft.add(child);
+ }
+ } else {
+ childrenToTheLeft.add(child);
+ }
+ }
+ }
+
+ ResponseWriter writer = context.getResponseWriter();
+ for (Iterator<UIComponent> it = childrenToTheLeft.iterator();
it.hasNext();) {
+
+ UIComponent child = it.next();
+
+ if (!(child instanceof AbstractToolBarGroup)) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
concatClasses("rf-tb-itm", contentClass), null);
+ if (isPropertyRendered(contentStyle)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE,
contentStyle, null);
+ }
+ encodeEventsAttributes(context, toolBar);
+ }
+
+ child.encodeAll(context);
+
+ if (!(child instanceof AbstractToolBarGroup)) {
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+
+
+
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(context, toolBar, writer);
+ }
+ }
+
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, "width:100%",
null);
+ writer.endElement(HtmlConstants.TD_ELEM);
+
+ for (Iterator<UIComponent> it = childrenToTheRight.iterator();
it.hasNext();) {
+ UIComponent child = it.next();
+ child.encodeAll(context);
+ if (it.hasNext()) {
+ insertSeparatorIfNeed(context, toolBar, writer);
+ }
+ }
+ }
+ }
+
+ public void encodeItem(FacesContext facesContext, UIComponent component,
ResponseWriter writer, String contentStyle, String contentClass) throws IOException {
+ if (!(component instanceof AbstractToolBarGroup)) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
concatClasses("rf-tb-itm", contentClass), null);
+ if (isPropertyRendered(contentStyle)) {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, contentStyle,
null);
+ }
+ encodeEventsAttributes(facesContext, component);
+ }
+
+ component.encodeAll(facesContext);
+
+ if (!(component instanceof AbstractToolBarGroup)) {
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+ }
+
+ /**
+ * Inserts separator between toolbar items. Uses facet "itemSeparator" if
it
+ * is set and default separator implementation if facet is not set.
+ *
+ * @param context
+ * - faces context
+ * @param component
+ * - component
+ * @param writer
+ * - response writer
+ * @throws IOException
+ * - in case of IOException during writing to the ResponseWriter
+ */
+ protected void insertSeparatorIfNeed(FacesContext context, UIComponent component,
ResponseWriter writer)
+ throws IOException {
+ UIComponent separatorFacet = component.getFacet("itemSeparator");
+ boolean isSeparatorFacetRendered = (separatorFacet != null) ?
separatorFacet.isRendered() : false;
+ if (isSeparatorFacetRendered) {
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-tb-sep",
null);
+ separatorFacet.encodeAll(context);
+ writer.endElement(HtmlConstants.TD_ELEM);
+ } else {
+ insertDefaultSeparatorIfNeed(context, component, writer);
+ }
+ }
+
+ /**
+ * Inserts default separator. Possible values are: "square",
"disc", "grid",
+ * "line" - for separators provided by component implementation;
"none" -
+ * for no separators between toolbar items; URI string value - for custom
+ * images specified by the page author.
+ *
+ * @param context
+ * - faces context
+ * @param component
+ * - component
+ * @param writer
+ * - response writer
+ * @throws IOException
+ * - in case of IOException during writing to the ResponseWriter
+ */
+ protected void insertDefaultSeparatorIfNeed(FacesContext context, UIComponent
component, ResponseWriter writer)
+ throws IOException {
+ String itemSeparator = (String)
component.getAttributes().get("itemSeparator");
+
+ if (itemSeparator != null && itemSeparator.trim().length() != 0
+ &&
!itemSeparator.equalsIgnoreCase(ItemSeparators.NONE.toString())) {
+
+ ItemSeparators separator = null;
+ if (itemSeparator.equalsIgnoreCase(ItemSeparators.SQUARE.toString())) {
+ separator = ItemSeparators.SQUARE;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.DISC.toString())) {
+ separator = ItemSeparators.DISC;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.GRID.toString())) {
+ separator = ItemSeparators.GRID;
+ } else if (itemSeparator.equalsIgnoreCase(ItemSeparators.LINE.toString())) {
+ separator = ItemSeparators.LINE;
+ }
+
+ writer.startElement(HtmlConstants.TD_ELEM, component);
+ String separatorClass = "rf-tb-sep";
+
+ if (separator != null) {
+ String itemSeparatorClass = "rf-tb-sep-" +
separator.toString().toLowerCase();
+ separatorClass = concatClasses(separatorClass, itemSeparatorClass,
(String) component.getAttributes().get("separatorClass"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass,
null);
+ } else {
+ concatClasses(separatorClass, (String)
component.getAttributes().get("separatorClass"));
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass,
null);
+
+ String uri = ViewUtil.getResourceURL(itemSeparator);
+ writer.startElement(HtmlConstants.IMG_ELEMENT, component);
+ writer.writeAttribute(HtmlConstants.SRC_ATTRIBUTE, uri, null);
+ writer.writeAttribute(HtmlConstants.ALT_ATTRIBUTE, "", null);
+ writer.endElement(HtmlConstants.IMG_ELEMENT);
+ }
+
+ writer.endElement(HtmlConstants.TD_ELEM);
+ }
+ }
+
+ protected Class<? extends javax.faces.component.UIComponent>
getComponentClass() {
+ return AbstractToolBar.class;
+ }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ protected void encodeEventsAttributes(FacesContext facesContext, UIComponent
component)
+ throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
ITEMS_HANDLER_ATTRIBUTES);
+ }
+
+ protected boolean isPropertyRendered(String property) {
+ return ((null != property && !"".equals(property)));
+ }
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/DotSeparatorImage.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,71 @@
+/**
+ * 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;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Area;
+import java.awt.geom.Ellipse2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+@DynamicUserResource
+public class DotSeparatorImage extends ToolBarSeparatorImage {
+
+ private static final Dimension DIMENSIONS = new Dimension(9, 9);
+
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+
+ public void paint(Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+
+ Color gradientColorStart = Color.WHITE;
+ Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
+ Ellipse2D inSquare = new Ellipse2D.Double(2, 2, DIMENSIONS.getWidth() - 4,
DIMENSIONS.getHeight() - 4);
+ GradientPaint paint = new GradientPaint((float) 3, (float) 3,
gradientColorStart,
+ (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2,
gradientColorEnd);
+ g2d.setPaint(paint);
+ g2d.fill(inSquare);
+
+ Ellipse2D outSquare = new Ellipse2D.Double(0, 0, DIMENSIONS.getWidth(),
DIMENSIONS.getHeight());
+ Ellipse2D midSquare = new Ellipse2D.Double(1, 1, DIMENSIONS.getWidth() - 2,
DIMENSIONS.getHeight() - 2);
+
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ Area area2 = new Area(outSquare);
+ area2.subtract(new Area(midSquare));
+ g2d.fill(area2);
+
+ g2d.setColor(new Color(this.getHeaderGradientColor()));
+ Area area = new Area(midSquare);
+ area.subtract(new Area(inSquare));
+ g2d.fill(area);
+ }
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/GridSeparatorImage.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,39 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.TexturePaint;
+import java.awt.image.BufferedImage;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class GridSeparatorImage extends ToolBarSeparatorImage {
+
+ public Dimension getDimension() {
+ return calculateDimension();
+ }
+
+ public void paint(Graphics2D g2d) {
+ Dimension dimensions = calculateDimension();
+
+ BufferedImage texture = new BufferedImage(3, 3, BufferedImage.TYPE_INT_ARGB);
+ Graphics2D txG2d = texture.createGraphics();
+ txG2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ txG2d.fillRect(0, 0, 2, 2);
+ txG2d.setColor(new Color(255, 255, 255, 150));
+ txG2d.fillRect(0, 0, 1, 1);
+ txG2d.dispose();
+ g2d.setPaint(new TexturePaint(texture, new Rectangle(1, 1, 3, 3)));
+ g2d.fillRect(0, 0, dimensions.width, dimensions.height);
+ }
+
+ private Dimension calculateDimension() {
+ int h = (int)(this.getSeparatorHeight() * 0.8);
+ h = h - h % 3;
+ int w = 9;
+ return new Dimension(w, h);
+ }
+}
\ No newline at end of file
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/LineSeparatorImage.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,31 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class LineSeparatorImage extends ToolBarSeparatorImage {
+
+ public Dimension getDimension() {
+ return calculateDimension();
+ }
+
+ public void paint(Graphics2D g2d) {
+ Dimension dimensions = calculateDimension();
+ g2d.setStroke(new BasicStroke(1));
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ g2d.fillRect(-1, -1, dimensions.width + 2, dimensions.height + 2);
+ g2d.setColor(new Color(255, 255, 255, 150));
+ g2d.drawLine(1, -1, 1, dimensions.height + 2);
+ }
+
+ private Dimension calculateDimension() {
+ int h = this.getSeparatorHeight();
+ int w = 2;
+ return new Dimension(w, h);
+ }
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,48 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Area;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+
+import org.richfaces.resource.DynamicUserResource;
+
+@DynamicUserResource
+public class SquareSeparatorImage extends ToolBarSeparatorImage {
+
+ private static final Dimension DIMENSIONS = new Dimension(9, 9);
+
+ public Dimension getDimension() {
+ return DIMENSIONS;
+ }
+
+ public void paint(Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
+
+ Color gradientColorStart = Color.WHITE;
+ Color gradientColorEnd = new Color(this.getHeaderBackgroundColor());
+ Rectangle2D inSquare = new Rectangle2D.Double(2, 2, DIMENSIONS.getWidth() - 4,
DIMENSIONS.getHeight() - 4);
+ GradientPaint paint = new GradientPaint((float) 2, (float) 2,
gradientColorStart,
+ (float) DIMENSIONS.getWidth() - 2, (float) DIMENSIONS.getHeight() - 2,
gradientColorEnd);
+ g2d.setPaint(paint);
+ g2d.fill(inSquare);
+
+ RoundRectangle2D outSquare = new RoundRectangle2D.Double(0, 0,
DIMENSIONS.getWidth(), DIMENSIONS.getHeight(),
+ 4, 4);
+ Rectangle2D midSquare = new Rectangle2D.Double(1, 1, DIMENSIONS.getWidth() - 2,
DIMENSIONS.getHeight() - 2);
+
+ g2d.setColor(new Color(this.getHeaderBackgroundColor()));
+ Area area2 = new Area(outSquare);
+ area2.subtract(new Area(midSquare));
+ g2d.fill(area2);
+
+ g2d.setColor(new Color(this.getHeaderGradientColor()));
+ Area area = new Area(midSquare);
+ area.subtract(new Area(inSquare));
+ g2d.fill(area);
+ }
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,99 @@
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DUserResource;
+import org.richfaces.resource.PostConstructResource;
+import org.richfaces.resource.ResourceParameter;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+public abstract class ToolBarSeparatorImage implements Java2DUserResource,
StateHolderResource {
+
+ private int headerBackgroundColor;
+ private int separatorHeight;
+ private int headerGradientColor;
+
+ public int getHeaderBackgroundColor() {
+ return headerBackgroundColor;
+ }
+
+ public void setHeaderBackgroundColor(int bgColor) {
+ this.headerBackgroundColor = bgColor;
+ }
+
+ public int getSeparatorHeight() {
+ return separatorHeight;
+ }
+
+ @ResourceParameter(defaultValue = "9")
+ public void setSeparatorHeight(int separatorHeight) {
+ this.separatorHeight = separatorHeight;
+ }
+
+ public int getHeaderGradientColor() {
+ return headerGradientColor;
+ }
+
+ public void setHeaderGradientColor(int headerGradientColor) {
+ this.headerGradientColor = headerGradientColor;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ dataOutput.writeInt(headerBackgroundColor);
+ dataOutput.writeInt(separatorHeight);
+ dataOutput.writeInt(headerGradientColor);
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException
{
+ this.headerBackgroundColor = dataInput.readInt();
+ this.separatorHeight = dataInput.readInt();
+ this.headerGradientColor = dataInput.readInt();
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ @PostConstructResource
+ public final void initialize() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance(context).getDefaultSkin(context);
+
+ String skinParameter = "headerBackgroundColor";
+ String tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+ this.setHeaderBackgroundColor(Color.decode(tmp == null ? "#224986" :
tmp).getRGB());
+
+ skinParameter = "headerGradientColor";
+ tmp = (String) skin.getParameter(context, skinParameter);
+ if (null == tmp || "".equals(tmp)) {
+ tmp = (String) defaultSkin.getParameter(context, skinParameter);
+ }
+ this.setHeaderGradientColor(Color.decode(tmp == null ? "#CCCCFF" :
tmp).getRGB());
+ }
+}
Added:
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss
===================================================================
---
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss
(rev 0)
+++
sandbox/trunk/ui/toolbar/ui/src/main/resources/META-INF/resources/org.richfaces/toolBar.ecss 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,48 @@
+.rf-tb {
+ border:1px solid;
+ border-color:'#{richSkin.panelBorderColor}';
+ color:'#{richSkin.headerTextColor}';
+ font-family:'#{richSkin.headerFamilyFont}';
+ font-size:'#{richSkin.headerSizeFont}';
+ font-weight:'#{richSkin.headerWeightFont}';
+ padding:0px;
+ background-color:'#{richSkin.headerBackgroundColor}';
+ background-position:left top;
+ background-repeat:repeat-x;
+ /*check gradient from headerGradientColor to headerBackgroundColor*/
+
background-image:url("#{resource['org.richfaces.renderkit.html.GradientA']}");
+ height:36px;
+ width:100%;
+}
+
+.rf-tb-itm {
+ padding:0 8px;
+ white-space:nowrap;
+}
+
+.rf-tb-sep {
+ padding:0 10px;
+ text-align:center;
+ background-repeat:no-repeat;
+ background-position:center center;
+}
+
+.rf-tb-cntr{
+ vertical-align:middle;
+}
+
+.rf-tb-sep-grid {
+
background-image:url("#{resource['org.richfaces.renderkit.html.images.GridSeparatorImage']}");
+}
+
+.rf-tb-sep-line {
+
background-image:url("#{resource['org.richfaces.renderkit.html.images.LineSeparatorImage']}");
+}
+
+.rf-tb-sep-disc {
+
background-image:url("#{resource['org.richfaces.renderkit.html.images.DotSeparatorImage']}");
+}
+
+.rf-tb-sep-square {
+
background-image:url("#{resource['org.richfaces.renderkit.html.images.SquareSeparatorImage']}");
+}
\ No newline at end of file
Added: sandbox/trunk/ui/toolbar/ui/src/main/templates/toolBar.template.xml
===================================================================
--- sandbox/trunk/ui/toolbar/ui/src/main/templates/toolBar.template.xml
(rev 0)
+++ sandbox/trunk/ui/toolbar/ui/src/main/templates/toolBar.template.xml 2010-11-15
10:55:11 UTC (rev 20044)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.ToolBarRenderer</cdk:class>
+
<cdk:superclass>org.richfaces.renderkit.html.ToolBarRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.ToolBar</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ToolBarRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <table border="0" cellpadding="0"
cellspacing="0" id="#{clientId}"
width="#{component.attributes['width']}"
+ height="#{component.attributes['height']}" class="rf-tb
#{component.attributes['styleClass']}"
+ style="#{component.attributes['style']}"
+ cdk:passThroughWithExclusions="">
+ <tr class="rf-tb-cntr">
+ <cdk:body />
+ </tr>
+ </table>
+ </cc:implementation>
+</cdk:root>