Author: abelevich
Date: 2010-12-03 09:42:06 -0500 (Fri, 03 Dec 2010)
New Revision: 20357
Removed:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
trunk/ui/output/ui/src/main/templates/toolBar.template.xml
Log:
rename to the *toolbar* instead of toolBar
Deleted: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java 2010-12-03
14:30:15 UTC (rev 20356)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBar.java 2010-12-03
14:42:06 UTC (rev 20357)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-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();
-
-}
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java 2010-12-03
14:30:15 UTC (rev 20356)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractToolBarGroup.java 2010-12-03
14:42:06 UTC (rev 20357)
@@ -1,106 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-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;
- }
-
-}
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2010-12-03
14:30:15 UTC (rev 20356)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2010-12-03
14:42:06 UTC (rev 20357)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-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
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2010-12-03
14:30:15 UTC (rev 20356)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2010-12-03
14:42:06 UTC (rev 20357)
@@ -1,279 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-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.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";
- concatClasses(separatorClass, (String)
component.getAttributes().get("separatorClass"));
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass, null);
-
- if (separator != null) {
- String itemSeparatorClass = "rf-tb-sep-" +
separator.toString().toLowerCase();
- writer.startElement(HtmlConstants.DIV_ELEM, component);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, itemSeparatorClass,
null);
- writer.write(" ");
- writer.endElement(HtmlConstants.DIV_ELEM);
- } else {
- concatClasses(separatorClass, (String)
component.getAttributes().get("separatorClass"));
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, separatorClass,
null);
-
- String uri = RenderKitUtils.getResourceURL(itemSeparator, context);
- 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)));
- }
-}
Deleted:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-12-03
14:30:15 UTC (rev 20356)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/images/ToolBarSeparatorImage.java 2010-12-03
14:42:06 UTC (rev 20357)
@@ -1,99 +0,0 @@
-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());
- }
-}
Deleted: trunk/ui/output/ui/src/main/templates/toolBar.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/toolBar.template.xml 2010-12-03 14:30:15 UTC
(rev 20356)
+++ trunk/ui/output/ui/src/main/templates/toolBar.template.xml 2010-12-03 14:42:06 UTC
(rev 20357)
@@ -1,26 +0,0 @@
-<?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>