From adffaces-commits-return-794-apmail-incubator-adffaces-commits-archive=incubator.apache.org@incubator.apache.org Tue Sep 12 00:34:19 2006 Return-Path: Delivered-To: apmail-incubator-adffaces-commits-archive@locus.apache.org Received: (qmail 10898 invoked from network); 12 Sep 2006 00:34:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Sep 2006 00:34:19 -0000 Received: (qmail 79672 invoked by uid 500); 12 Sep 2006 00:34:19 -0000 Delivered-To: apmail-incubator-adffaces-commits-archive@incubator.apache.org Received: (qmail 79649 invoked by uid 500); 12 Sep 2006 00:34:18 -0000 Mailing-List: contact adffaces-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-dev@incubator.apache.org Delivered-To: mailing list adffaces-commits@incubator.apache.org Delivered-To: moderator for adffaces-commits@incubator.apache.org Received: (qmail 3607 invoked by uid 99); 7 Sep 2006 00:11:21 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440910 [1/8] - in /incubator/adffaces/trunk/trinidad: src/site/xdoc/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/ trinidad-impl/src/main/resources/META-INF/adf/styles/ trinidad-impl/src/test/resourc... Date: Thu, 07 Sep 2006 00:10:54 -0000 To: adffaces-commits@incubator.apache.org From: slessard@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060907001057.1DE571A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: slessard Date: Wed Sep 6 17:10:53 2006 New Revision: 440910 URL: http://svn.apache.org/viewvc?view=rev&rev=440910 Log: Applied my patch for panelBox selectors and added doc about them in skin-selectors.xml. I destroyed some of the aliases as they were not useful at all. For example there was .AFPanelBoxContent:alias, but you can get the exact same result using af|panelBox::content. Modified: incubator/adffaces/trunk/trinidad/src/site/xdoc/skin-selectors.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelBoxRenderer.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SkinSelectors.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlConstants.java incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/resources/META-INF/adf/styles/base-desktop.xss incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimal-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalIE-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalIERtl-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalInacc-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalPPC-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalSaf-golden.xml incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalScrRdr-golden.xml Modified: incubator/adffaces/trunk/trinidad/src/site/xdoc/skin-selectors.xml URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/src/site/xdoc/skin-selectors.xml?view=diff&rev=440910&r1=440909&r2=440910 ============================================================================== --- incubator/adffaces/trunk/trinidad/src/site/xdoc/skin-selectors.xml (original) +++ incubator/adffaces/trunk/trinidad/src/site/xdoc/skin-selectors.xml Wed Sep 6 17:10:53 2006 @@ -1526,30 +1526,25 @@ the panelBox header text (set by the text attribute on tr:panelBox). Styles can be applied to the body region via the af|panelBox::body selector. Similarly, styles for the header region are specified via - the af|panelBox::header selector.

-

These two regions are themselves rendered within an outer container - that can be styled as well. There are two different sets of selectors - for the outer region, depending on whether a header is present. If a - header is present, one of the following selectors is used, depending - on the panelBox background color (background color can be quickly - configured to dark, medium, or light using the background attribute - on panelBox).

+ the af|panelBox::header selector. Both section can be skinned with the + af|panelBox::content selector

+

The content is rendered within a layout container that allow round + edges and such. You can access this container using af|panelBox::top, + af|panelBox::bottom, af|panelBox::start, af|panelBox::end, + af|panelBox::top-start, af|panelBox::top-end, af|panelBox::bottom-start + and af|panelBox::bottom-end. To use round edges, set a background + image on each of the corners and set the width and height of those + corners to the used image's size. Here're some condition for it to + work properly:

    -
  • af|panelBox::dark
  • -
  • af|panelBox::medium
  • -
  • af|panelBox::light
  • -
  • af|panelBox::transparent
  • -
-

- If - no header is present - , the outer container instead uses the following style classes: -

-
    -
  • af|panelBox::content-dark
  • -
  • af|panelBox::content-medium
  • -
  • af|panelBox::content-light
  • -
  • af|panelBox::content-transparent
  • +
  • The top edge background image should have the same height as both + top corner images.
  • +
  • The bottom edge background image should have the same height as both + bottom corner images.
  • +
  • The start edge background image should have the same width as the + top start corner image and the bottom start corner widths.
  • +
  • The end edge background image should have the same width as the + top end corner image and the bottom end corner widths.

In order to apply a style to the panelBox body or header for a particular background type, a contextual selector can be used. For @@ -1557,20 +1552,6 @@ of dark panelBox header and body regions:

af|panelBox::dark af|panelBox::header {...} af|panelBox::dark
              af|panelBox::body {...}
-

And the following selector can be used to change the properties of - the dark panelBox body for panelBox which do not have a header:

-
af|panelBox::content-dark af|panelBox::body {...}
-

In order to make it easier to apply common style properties across - panelBox of different background types, several alias styles are - exposed. For example, the .AFPanelBoxDarkBackground:alias aliased - style provides a way to set the background color for all dark - panelBox. This aliased style is used regardless of whether the outer - container uses the af|panelBox::dark or af|panelBox::content-dark - style class (ie. whether or not a header is present).

-

The panelBox defines four sets of icons: one set for each background - type. Customizers are not required to specify icons for all of the - different icon names. If an icon is omitted, the panelBox will - attempt to expand to fill any empty space.

- - - - - - - - - - - - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
@@ -1582,397 +1563,76 @@ Description
af|panelBox::bodyStyles the body region. The body region is rendered whether or - not the panelBox has a header.
af|panelBox::headerStyles the header region.
af|panelBox::darkStyles the outer container of the dark panelBox when there is a - header.
af|panelBox::mediumStyles the outer container of the medium panelBox when there is + af|panelBox::transparentStyles the container of transparent panelBox when there is a header.
af|panelBox::lightStyles the outer container of light panelBox when there is a + Styles the container of light panelBox when there is a header.
af|panelBox::transparentStyles the outer container of transparent panelBox when there is + af|panelBox::mediumStyles the container of the medium panelBox when there is a header.
af|panelBox::content-darkStyles the dark panelBox when there is no header.
af|panelBox::content-mediumStyles the medium panelBox when there is no header.
af|panelBox::content-lightStyles the light panelBox when there is no header.
af|panelBox::content-transparentStyles the transparent panelBox when there is no header.
.AFPanelBox:aliasThis aliased style can be used to specify common properties that - are shared by the af|panelBox::dark, af|panelBox::medium, - af|panelBox::light and af|panelBox::transparent style classes - (classes when the panelBox has a header).
.AFBoxContent:aliasThis aliased style can be used to specify common properties that - are shared by the af|panelBox::content-dark, - af|panelBox::content-medium, af|panelBox::content-light and - af|panelBox::content-transparent style classes. - AFShuttleBoxContent:alias includes this style.
.AFPanelBoxBody:alias -

This aliased style class be used to specify common properties - that are shared by the four types of the - panelBox<Background> body regions. It is included by the - following selectors:

-
    -
  • af|panelBox::dark af|panelBox::body
  • -
  • af|panelBox::medium af|panelBox::body
  • -
  • af|panelBox::light af|panelBox::body
  • -
  • af|panelBox::transparent af|panelBox::body
  • -
-
.AFBoxContentBody:alias -

This aliased style class be used to specify common properties - that are shared by the four types of the - af|panelBox::content<Background> body regions. It is - included by the following selectors:

-
    -
  • af|panelBox::content-dark af|panelBox::body
  • -
  • af|panelBox::content-medium af|panelBox::body
  • -
  • af|panelBox::content-light af|panelBox::body
  • -
  • af|panelBox::content-transparent af|panelBox::body
  • -
  • .AFShuttleBoxContentBody:alias
  • -
-
.AFPanelBoxDarkBackground:alias -

This aliased style is used to set the background color for dark - panelBox. It is included by the following selectors:

-
    -
  • af|panelBox::dark af|panelBox::body
  • -
  • af|panelBox::content-dark af|panelBox::body
  • -
-
.AFPanelBoxMediumBackground:alias -

This aliased style is used to set the background color for - medium panelBox. It is included by the following selectors:

-
    -
  • af|panelBox::medium af|panelBox::body
  • -
  • af|panelBox::content-medium af|panelBox::body
  • -
-
.AFBoxBackground:alias -

This aliased style is used to set the background color for - light panelBox and for the seletMany/selectOrder shuttle's box. - It is included by the following selectors:

-
    -
  • af|panelBox::light af|panelBox::body
  • -
  • af|panelBox::content-light af|panelBox::body
  • -
  • AFShuttleBoxBackground:alias
  • -
-
- Icon Selectors -
NameDescription
af|panelBox::dark-header-start-iconThis icon is rendered at the start of the header region for dark - panelBoxes.
af|panelBox::dark-header-end-iconThis icon is rendered at the end of the header region for dark - panelBoxes.
af|panelBox::dark-header-background-iconThis icon is rendered in the background of the header region for - dark panelBoxes.
af|panelBox::dark-bottom-start-iconThis icon is rendered in the body region of dark panelBoxes at - the bottom starting corner (ie. at the bottom left corner for - left to right languages.)
af|panelBox::dark-bottom-end-iconThis icon is rendered in the body region of dark panelBoxes at - the bottom ending corner (ie. at the bottom right corner for - left to right languages.)
af|panelBox::dark-bottom-background-iconThis icon is rendered in the body region of dark panelBoxes as - the background in between the af|panelBox::dark-bottom-start and - af|panelBox::dark-bottom-end icons.
af|panelBox::dark-top-start-iconThis icon is rendered in the body region of dark panelBoxes at - the top starting corner (ie. at the top left corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::dark-top-end-iconThis icon is rendered in the body region of dark panelBoxes at - the top ending corner (ie. at the top right corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::dark-top-background-iconThis icon is rendered in the body region of dark panelBoxes as - the background in between the af|panelBox::dark-top-start and - af|panelBox::dark-top-end icons. Note: the top icons are only - rendered for contentContainers which do not have headers.
af|panelBox::dark-start-background-iconThis icon is rendered as the background image on the starting - side of the body region in dark panelBoxes.
af|panelBox::dark-end-background-iconThis icon is rendered as the background image on the ending side - of the body region in dark panelBoxes.
af|panelBox::medium-header-start-iconThis icon is rendered at the start of the header region for - medium panelBoxes.
af|panelBox::medium-header-end-iconThis icon is rendered at the end of the header region for medium - panelBoxes.
af|panelBox::medium-header-background-iconThis icon is rendered in the background of the header region for - medium panelBoxes.
af|panelBox::medium-bottom-start-iconThis icon is rendered in the body region of medium panelBoxes at - the bottom starting corner (ie. at the bottom left corner for - left to right languages.)
af|panelBox::medium-bottom-end-iconThis icon is rendered in the body region of medium panelBoxes at - the bottom ending corner (ie. at the bottom right corner for - left to right languages.)
af|panelBox::medium-bottom-background-iconThis icon is rendered in the body region of medium panelBoxes as - the background in between the af|panelBox::medium-bottom-start - and af|panelBox::medium-bottom-end icons.
af|panelBox::medium-top-start-iconThis icon is rendered in the body region of medium panelBoxes at - the top starting corner (ie. at the top left corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::medium-top-end-iconThis icon is rendered in the body region of medium panelBoxes at - the top ending corner (ie. at the top right corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::medium-top-background-iconThis icon is rendered in the body region of medium panelBoxes as - the background in between the af|panelBox::medium-top-start and - af|panelBox::medium-top-end icons. Note: the top icons are only - rendered for contentContainers which do not have headers.
af|panelBox::medium-start-background-iconThis icon is rendered as the background image on the starting - side of the body region in medium panelBoxes.
af|panelBox::medium-end-background-iconThis icon is rendered as the background image on the ending side - of the body region in medium panelBoxes.
af|panelBox::light-header-start-iconThis icon is rendered at the start of the header region for - light panelBoxes.
af|panelBox::light-header-end-iconThis icon is rendered at the end of the header region for light - panelBoxes.
af|panelBox::light-header-background-iconThis icon is rendered in the background of the header region for - light panelBoxes.
af|panelBox::light-bottom-start-iconThis icon is rendered in the body region of light panelBoxes at - the bottom starting corner (ie. at the bottom left corner for - left to right languages.)
af|panelBox::light-bottom-end-iconThis icon is rendered in the body region of light panelBoxes at - the bottom ending corner (ie. at the bottom right corner for - left to right languages.)
af|panelBox::light-bottom-background-iconThis icon is rendered in the body region of light panelBoxes as - the background in between the af|panelBox::light-bottom-start - and af|panelBox::light-bottom-end icons.
af|panelBox::light-top-start-iconThis icon is rendered in the body region of light panelBoxes at - the top starting corner (ie. at the top left corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::light-top-end-iconThis icon is rendered in the body region of light panelBoxes at - the top ending corner (ie. at the top right corner for left to - right languages.) Note: the top icons are only rendered for - panelBoxes which do not have headers.
af|panelBox::light-top-background-iconThis icon is rendered in the body region of light panelBoxes as - the background in between the af|panelBox::light-top-start and - af|panelBox::light-top-end icons. Note: the top icons are only - rendered for panelBoxes which do not have headers.w
af|panelBox::light-start-background-iconThis icon is rendered as the background image on the starting - side of the body region in light panelBoxes.
af|panelBox::light-end-background-iconThis icon is rendered as the background image on the ending side - of the body region in light panelBoxes.af|panelBox::darkStyles the container of the dark panelBox when there is a + header.
af|panelBox::transparent-header-start-iconThis icon is rendered at the start of the header region for - transparent panelBoxes.af|panelBox::contentStyles the content region, that is the central frame of the box, + including both the header and the body.
af|panelBox::transparent-header-end-iconThis icon is rendered at the end of the header region for - transparent panelBoxes.af|panelBox::bodyStyles the body region. The body region is rendered whether or + not the panelBox has a header.
af|panelBox::transparent-header-background-iconThis icon is rendered in the background of the header region for - transparent panelBoxes.af|panelBox::headerStyles the header region.
af|panelBox::transparent-bottom-start-iconThis icon is rendered in the body region of transparent - panelBoxes at the bottom starting corner (ie. at the bottom left - corner for left to right languages.)af|panelBox::top-startStyles the top start corner of the box's container. In LTR this is + the upper left corner.
af|panelBox::transparent-bottom-end-iconThis icon is rendered in the body region of transparent - panelBoxes at the bottom ending corner (ie. at the bottom right - corner for left to right languages.)af|panelBox::topStyles the top edge of the box's container.
af|panelBox::transparent-bottom-background-iconThis icon is rendered in the body region of transparent - panelBoxes as the background in between the - af|panelBox::transparent-bottom-start and - af|panelBox::transparent-bottom-end icons.af|panelBox::top-endStyles the top end corner of the box's container. In LTR this is + the upper right corner.
af|panelBox::transparent-top-start-iconThis icon is rendered in the body region of transparent - panelBoxes at the top starting corner (ie. at the top left - corner for left to right languages.) Note: the top icons are - only rendered for panelBoxes which do not have headers.af|panelBox::startStyles the start edge of the box's container. In LTR this is + the left side of the box.
af|panelBox::transparent-top-end-iconThis icon is rendered in the body region of transparent - panelBoxes at the top ending corner (ie. at the top right corner - for left to right languages.) Note: the top icons are only - rendered for panelBoxes which do not have headers.af|panelBox::endStyles the end edge of the box's container. In LTR this is + the right side of the box.
af|panelBox::transparent-top-background-iconThis icon is rendered in the body region of transparent - panelBoxes as the background in between the - af|panelBox::transparent-top-start and - af|panelBox::transparent-top-end icons. Note: the top icons are - only rendered for panelBoxes which do not have headers.af|panelBox::bottom-startStyles the bottom start corner of the box's container. In LTR this is + the lower left corner.
af|panelBox::transparent-start-background-iconThis icon is rendered as the background image on the starting - side of the body region in transparent panelBoxes.af|panelBox::bottomStyles the bottom edge of the box's container.
af|panelBox::transparent-end-background-iconThis icon is rendered as the background image on the ending side - of the body region in transparent panelBoxes.af|panelBox::bottom-endStyles the bottom end corner of the box's container. In LTR this is + the lower right corner.
Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelBoxRenderer.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelBoxRenderer.java?view=diff&rev=440910&r1=440909&r2=440910 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelBoxRenderer.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/PanelBoxRenderer.java Wed Sep 6 17:10:53 2006 @@ -16,16 +16,17 @@ package org.apache.myfaces.trinidadinternal.renderkit.core.xhtml; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; - import javax.faces.context.ResponseWriter; import org.apache.myfaces.trinidad.bean.FacesBean; import org.apache.myfaces.trinidad.bean.PropertyKey; import org.apache.myfaces.trinidad.component.core.layout.CorePanelBox; - import org.apache.myfaces.trinidadinternal.renderkit.RenderingContext; public class PanelBoxRenderer @@ -51,6 +52,31 @@ _contentStyleKey = type.findKey("contentStyle"); } + public String getRootStyleClass(FacesBean bean) + { + Object background = bean.getProperty(_backgroundKey); + if(_BACKGROUND_TRANSPARENT.equals(background)) + { + return SkinSelectors.AF_PANEL_BOX_TRANSPARENT_STYLE_CLASS; + } + else if(_BACKGROUND_LIGHT.equals(background)) + { + return SkinSelectors.AF_PANEL_BOX_LIGHT_STYLE_CLASS; + } + else if( _BACKGROUND_MEDIUM.equals(background)) + { + return SkinSelectors.AF_PANEL_BOX_MEDIUM_STYLE_CLASS; + } + else if( _BACKGROUND_DARK.equals(background)) + { + return SkinSelectors.AF_PANEL_BOX_DARK_STYLE_CLASS; + } + else + { + return _BACKGROUND_DEFAULT_STYLE_CLASS; + } + } + @Override public boolean getRendersChildren() { @@ -59,33 +85,42 @@ @Override protected void encodeAll( - FacesContext context, - RenderingContext arc, - UIComponent component, - FacesBean bean) throws IOException + FacesContext context, + RenderingContext arc, + UIComponent component, + FacesBean bean) throws IOException { super.encodeAll(context, arc, component, bean); + + List children = _getRenderedChildren(component); + Object icon = bean.getProperty(_iconKey); + Object text = bean.getProperty(_textKey); + ResponseWriter writer = context.getResponseWriter(); - writer.startElement("table", component); + writer.startElement(XhtmlConstants.TABLE_ELEMENT, component); // The frame table renderId(context, component); renderAllAttributes(context, arc, bean); + writer.startElement(XhtmlConstants.TABLE_BODY_ELEMENT, null); - Object text = bean.getProperty(_textKey); - Object icon = bean.getProperty(_iconKey); - if(text!=null || icon!=null) + if(!children.isEmpty() || text != null || icon != null) { - _renderHeaderRow(context, arc, bean, text, icon); + // There's something to render to let build the frame + _renderContainerTopRow(context, arc, component); + + _renderMiddleRow(context, arc, component, bean, icon, text, children); + + _renderContainerBottomRow(context, arc, component); } - - _renderContentRow(context, arc, component, bean); - - writer.endElement("table"); + + writer.endElement(XhtmlConstants.TABLE_BODY_ELEMENT); + writer.endElement(XhtmlConstants.TABLE_ELEMENT); } @Override - protected void renderAllAttributes(FacesContext context, - RenderingContext arc, - FacesBean bean) throws IOException + protected void renderAllAttributes( + FacesContext context, + RenderingContext arc, + FacesBean bean) throws IOException { super.renderAllAttributes(context, arc, bean); OutputUtils.renderLayoutTableAttributes(context, arc, "0", null); @@ -93,123 +128,336 @@ @Override protected void renderStyleAttributes( - FacesContext context, - RenderingContext arc, - FacesBean bean) throws IOException + FacesContext context, + RenderingContext arc, + FacesBean bean) throws IOException { - renderStyleAttributes(context, arc, bean, _getDefaultStyleClass(bean)); + renderStyleAttributes(context, arc, bean, getRootStyleClass(bean)); } - private String _getDefaultStyleClass(FacesBean bean) - { - String styleClass = null; - Object background = bean.getProperty(_backgroundKey); + @SuppressWarnings("unchecked") + private List _getRenderedChildren(UIComponent component) + { + int childCount = component.getChildCount(); + if(childCount == 0) + { + return Collections.emptyList(); + } - // If we don't have a header, we use the - // af|panelBox::content- style classes. - // If we do have a header, we use the - // af|panelBox::transparent style classes + List result = new ArrayList(childCount); + List children = component.getChildren(); + for(UIComponent child : children) + { + if(child.isRendered()) + { + result.add(child); + } + } - // Check to see if we have a header - Object text = bean.getProperty(_textKey); - Object icon = bean.getProperty(_iconKey); - - if (text == null && icon == null) + return result; + } + + private void _renderContainerTopRow( + FacesContext context, + RenderingContext arc, + UIComponent component) throws IOException + { + ResponseWriter writer = context.getResponseWriter(); + writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null); + if(arc.isRightToLeft()) { - if (_BACKGROUND_TRANSPARENT.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_CONTENT_TRANSPARENT_STYLE_CLASS; - else if ( _BACKGROUND_MEDIUM.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_CONTENT_MEDIUM_STYLE_CLASS; - else if ( _BACKGROUND_DARK.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_CONTENT_DARK_STYLE_CLASS; - else - styleClass = XhtmlConstants.AF_PANEL_BOX_CONTENT_LIGHT_STYLE_CLASS; + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_END_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); } else { - if ( _BACKGROUND_TRANSPARENT.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_TRANSPARENT_STYLE_CLASS; - else if ( _BACKGROUND_MEDIUM.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_MEDIUM_STYLE_CLASS; - else if ( _BACKGROUND_DARK.equals(background)) - styleClass = XhtmlConstants.AF_PANEL_BOX_DARK_STYLE_CLASS; - else - styleClass = XhtmlConstants.AF_PANEL_BOX_LIGHT_STYLE_CLASS; + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_TOP_END_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); } - - return styleClass; + + writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT); } - private void _renderHeaderRow ( - FacesContext context, - RenderingContext arc, - FacesBean bean, - Object text, - Object icon) - throws IOException + private void _renderContainerBottomRow( + FacesContext context, + RenderingContext arc, + UIComponent component) throws IOException { - assert(text!=null || icon!=null); - ResponseWriter writer = context.getResponseWriter(); - writer.startElement("tr", null); - writer.startElement("td", null); - renderStyleClass(context, arc, XhtmlConstants.AF_PANEL_BOX_HEADER_STYLE_CLASS); + ResponseWriter writer = context.getResponseWriter(); + writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null); + if(arc.isRightToLeft()) + { + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_END_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + } + else + { + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BOTTOM_END_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + } - if(icon != null) + writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT); + } + + private void _renderMiddleRow( + FacesContext context, + RenderingContext arc, + UIComponent component, + FacesBean bean, + Object icon, + Object text, + List children) throws IOException + { + ResponseWriter writer = context.getResponseWriter(); + writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null); + + // Render left edge + if(arc.isRightToLeft()) + { + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_END_STYLE_CLASS); + + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + } + else { - writer.startElement("img", null); - OutputUtils.renderAltAndTooltipForImage(context, arc, - XhtmlConstants.EMPTY_STRING_ATTRIBUTE_VALUE); - writer.writeURIAttribute("src", icon, _iconKey.getName()); - writer.endElement("img"); + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); } - if(text != null) + // Render body + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + _renderBody(context, arc, component, bean, icon, text, children); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + + // Render right edge + if(arc.isRightToLeft()) { - writer.writeText(text, _textKey.getName()); + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_START_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); } - writer.endElement("td"); - writer.endElement("tr"); + else + { + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_END_STYLE_CLASS); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + } + + writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT); } - // Renders the table row which contains the - // contentContainer's child contents. - private void _renderContentRow( - FacesContext context, - RenderingContext arc, - UIComponent component, - FacesBean bean - ) throws IOException + private void _renderBody( + FacesContext context, + RenderingContext arc, + UIComponent component, + FacesBean bean, + Object icon, + Object text, + List children) throws IOException { ResponseWriter writer = context.getResponseWriter(); - Object style = bean.getProperty(_contentStyleKey); + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_BODY_STYLE_CLASS); - // Render the contents inside of its own table row - writer.startElement("tr", null); - - // Render the td with the .OraContentContainerContent style class - writer.startElement("td", null); - renderStyleClass(context, arc, XhtmlConstants.AF_PANEL_BOX_BODY_STYLE_CLASS); + if(!children.isEmpty() && (text != null || icon != null)) + { + // There's both a header and a content, use a table. + writer.startElement(XhtmlConstants.TABLE_ELEMENT, null); + OutputUtils.renderLayoutTableAttributes(context, arc, "0", null); + writer.startElement(XhtmlConstants.TABLE_BODY_ELEMENT, null); + + // Render header + writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null); + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + _renderHeader(context, arc, component, bean, icon, text); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT); + + // Render content + writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null); + writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null); + _renderContent(context, arc, component, bean, children); + writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT); + writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT); + + writer.endElement(XhtmlConstants.TABLE_BODY_ELEMENT); + writer.endElement(XhtmlConstants.TABLE_ELEMENT); + } + else if(text != null || icon != null) + { + // We only have a header, use a div as style class placeholder + writer.startElement(XhtmlConstants.DIV_ELEMENT, null); + _renderHeader(context, arc, component, bean, icon, text); + writer.endElement(XhtmlConstants.DIV_ELEMENT); + } + else + { + // We only have a content, use a div as style class placeholder + writer.startElement(XhtmlConstants.DIV_ELEMENT, null); + _renderContent(context, arc, component, bean, children); + writer.endElement(XhtmlConstants.DIV_ELEMENT); + } + } + + private void _renderHeader( + FacesContext context, + RenderingContext arc, + UIComponent component, + FacesBean bean, + Object icon, + Object text) throws IOException + { + ResponseWriter writer = context.getResponseWriter(); + + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_HEADER_STYLE_CLASS); + if(arc.isRightToLeft()) + { + if(text != null) + { + writer.writeText(text, _textKey.getName()); + } + + if(icon != null) + { + writer.startElement("img", null); + OutputUtils.renderAltAndTooltipForImage(context, + arc, + XhtmlConstants.EMPTY_STRING_ATTRIBUTE_VALUE); + + writer.writeURIAttribute("src", icon, _iconKey.getName()); + writer.endElement("img"); + } + } + else + { + if(icon != null) + { + writer.startElement("img", null); + OutputUtils.renderAltAndTooltipForImage(context, + arc, + XhtmlConstants.EMPTY_STRING_ATTRIBUTE_VALUE); + + writer.writeURIAttribute("src", icon, _iconKey.getName()); + writer.endElement("img"); + } + + if(text != null) + { + writer.writeText(text, _textKey.getName()); + } + } + } + + private void _renderContent( + FacesContext context, + RenderingContext arc, + UIComponent component, + FacesBean bean, + List children) throws IOException + { + ResponseWriter writer = context.getResponseWriter(); + + renderStyleClass(context, + arc, + SkinSelectors.AF_PANEL_BOX_CONTENT_STYLE_CLASS); + + Object style = bean.getProperty(_contentStyleKey); if(style != null) { writer.writeAttribute("style", style, null); } - encodeAllChildren(context, component); - - writer.endElement("td"); - writer.endElement("tr"); + for(UIComponent child : children) + { + encodeChild(context, child); + } } - - + private PropertyKey _textKey; private PropertyKey _iconKey; private PropertyKey _contentStyleKey; private PropertyKey _backgroundKey; - + + private static final String _BACKGROUND_LIGHT = "light"; private static final String _BACKGROUND_TRANSPARENT = "transparent"; private static final String _BACKGROUND_MEDIUM = "medium"; private static final String _BACKGROUND_DARK = "dark"; + private static final String _BACKGROUND_DEFAULT_STYLE_CLASS = + SkinSelectors.AF_PANEL_BOX_LIGHT_STYLE_CLASS; } Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SkinSelectors.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SkinSelectors.java?view=diff&rev=440910&r1=440909&r2=440910 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SkinSelectors.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/SkinSelectors.java Wed Sep 6 17:10:53 2006 @@ -373,7 +373,7 @@ // // // // - // ============================ tr:component ============================ // + // ======================== tr:inputNumberSpinbox ======================== // // // // // @@ -593,26 +593,42 @@ // // // ============================ Style classes ============================ // + // Root class + public static final String AF_PANEL_BOX_ROOT_STYLE_CLASS = + "af|panelBox"; + // panelBox parts public static final String AF_PANEL_BOX_BODY_STYLE_CLASS = - "af|panelBox::body"; - public static final String AF_PANEL_BOX_CONTENT_DARK_STYLE_CLASS = - "af|panelBox::content-dark"; - public static final String AF_PANEL_BOX_CONTENT_LIGHT_STYLE_CLASS = - "af|panelBox::content-light"; - public static final String AF_PANEL_BOX_CONTENT_MEDIUM_STYLE_CLASS = - "af|panelBox::content-medium"; - public static final String AF_PANEL_BOX_CONTENT_TRANSPARENT_STYLE_CLASS = - "af|panelBox::content-transparent"; - public static final String AF_PANEL_BOX_DARK_STYLE_CLASS = - "af|panelBox::dark"; + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::body"; + public static final String AF_PANEL_BOX_CONTENT_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::content"; public static final String AF_PANEL_BOX_HEADER_STYLE_CLASS = - "af|panelBox::header"; + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::header"; + // panelBox backgrounds + public static final String AF_PANEL_BOX_DARK_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::dark"; public static final String AF_PANEL_BOX_LIGHT_STYLE_CLASS = - "af|panelBox::light"; + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::light"; public static final String AF_PANEL_BOX_MEDIUM_STYLE_CLASS = - "af|panelBox::medium"; + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::medium"; public static final String AF_PANEL_BOX_TRANSPARENT_STYLE_CLASS = - "af|panelBox::transparent"; + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::transparent"; + // panelBox container + public static final String AF_PANEL_BOX_TOP_START_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::top-start"; + public static final String AF_PANEL_BOX_TOP_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::top"; + public static final String AF_PANEL_BOX_TOP_END_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::top-end"; + public static final String AF_PANEL_BOX_START_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::start"; + public static final String AF_PANEL_BOX_END_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::end"; + public static final String AF_PANEL_BOX_BOTTOM_START_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::bottom-start"; + public static final String AF_PANEL_BOX_BOTTOM_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::bottom"; + public static final String AF_PANEL_BOX_BOTTOM_END_STYLE_CLASS = + AF_PANEL_BOX_ROOT_STYLE_CLASS + "::bottom-end"; // // Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlConstants.java URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlConstants.java?view=diff&rev=440910&r1=440909&r2=440910 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlConstants.java (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/XhtmlConstants.java Wed Sep 6 17:10:53 2006 @@ -217,6 +217,7 @@ public static final String SCRIPT_ELEMENT = "script"; public static final String SPAN_ELEMENT = "span"; public static final String TABLE_DATA_ELEMENT = "td"; + public static final String TABLE_BODY_ELEMENT = "tbody"; public static final String TABLE_ELEMENT = "table"; public static final String TABLE_HEADER_ELEMENT = "th"; public static final String TABLE_ROW_ELEMENT = "tr"; Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/resources/META-INF/adf/styles/base-desktop.xss URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/resources/META-INF/adf/styles/base-desktop.xss?view=diff&rev=440910&r1=440909&r2=440910 ============================================================================== --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/resources/META-INF/adf/styles/base-desktop.xss (original) +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/resources/META-INF/adf/styles/base-desktop.xss Wed Sep 6 17:10:53 2006 @@ -1514,7 +1514,6 @@ - @@ -1541,18 +1540,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1567,29 +1614,6 @@ - - - - - - - - - - -