incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r425276 [8/12] - in /incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src: main/java/org/apache/myfaces/adfinternal/agent/ main/java/org/apache/myfaces/adfinternal/agent/parse/ main/java/org/apache/myfaces/adfi...
Date Tue, 25 Jul 2006 04:42:46 GMT
Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ComponentRefTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ComponentRefTag.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ComponentRefTag.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ComponentRefTag.java Mon Jul 24 21:42:41 2006
@@ -1,301 +1,301 @@
-/*
- * Copyright  2004-2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.adfinternal.taglib;
-
-import java.io.IOException;
-
-import java.io.Serializable;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-
-import javax.servlet.ServletException;
-import javax.servlet.jsp.JspException;
-
-import org.apache.myfaces.adf.logging.ADFLogger;
-import org.apache.myfaces.adf.component.UIXComponentRef;
-
-import org.apache.myfaces.adfinternal.metadata.RegionMetadata;
-import org.apache.myfaces.adfinternal.metadata.RegionMetadata.AttributeMetaData;
-import org.apache.myfaces.adfinternal.metadata.RegionMetadata.ComponentMetaData;
-import org.apache.myfaces.adfinternal.share.expl.Coercions;
-
-
-/**
- * This tag inserts a region (defined by <af:regionDef>)
- * into the current page. The "id" attribute is required on this
- * tag.
- *
- * @author The Oracle ADF Faces Team
- */
-public class ComponentRefTag extends UIXComponentRefTag
-{
-
-
-  public String getComponentType()
-  {
-    return "org.apache.myfaces.adf.ComponentRef";
-  }
-
-  public String getRendererType()
-  {
-    return null;
-  }
-
-  /**
-   * Indicate that a facet was moved. The region component must keep track
-   * of all facets that were moved so that they may be restored before the
-   * jsf jsp tag framework notices. If the jsf jsp tag framework notices
-   * that the facets are missing, it will recreate them, and that is undesireable
-   * as that will break the "binding" attribute support
-   * (on the facet) and will have performance consequences.
-   * @param region the component that the facet was moved from.
-   * @param facet the facet that was moved.
-   * @param component the component that the facet was moved to.
-   */
-  public static void addRelocatedFacet(
-    UIComponent region,
-    String facet,
-    UIComponent component)
-  {
-    Map map = (Map) region.getAttributes().get(_RELOCATED_FACETS_ATTRIBUTE);
-    if (map == null)
-    {
-      map = new HashMap(3);
-      region.getAttributes().put(_RELOCATED_FACETS_ATTRIBUTE, map);
-    }
-
-    // compute the ID to retrieve this relocated facet later.
-    // this is because we don't always have the relocated facet instance
-    // For example, after Serialization, the relocated facet instance is lost:
-    StringBuffer findId = new StringBuffer(component.getId());
-    for(UIComponent c = component.getParent(); c!=region; c = c.getParent())
-    {
-      if (c instanceof NamingContainer)
-      {
-        findId.insert(0, NamingContainer.SEPARATOR_CHAR);
-        findId.insert(0, c.getId());
-      }
-    }
-
-    map.put(facet, new RelocatedFacet(component, findId.toString()));
-  }
-
-  public int doStartTag() throws JspException
-  {
-    int returnVal = super.doStartTag();
-    UIComponent region = getComponentInstance();
-    Map<String,RelocatedFacet> map = (Map) region.getAttributes().get(_RELOCATED_FACETS_ATTRIBUTE);
-    if ((map != null) && (!map.isEmpty()))
-    {
-      // restore all the facets that were moved. Otherwise
-      // the jsf jsp tag framework will recreate them and that will
-      // break support for the "binding" attribute on the facets that were
-      // moved:
-      for(Entry<String,RelocatedFacet> e:map.entrySet())
-      {
-        String facet = e.getKey();
-        RelocatedFacet rf = e.getValue();
-        rf.restoreFacet(region, facet);
-      }
-      map.clear();
-    }
-
-    return returnVal;
-  }
-
-  public int doEndTag() throws JspException
-  {
-    UIXComponentRef region = (UIXComponentRef) getComponentInstance();
-    String regionType = region.getComponentType();
-
-    if (regionType == null)
-    {
-      _LOG.severe("'componentType' attribute is required");
-    }
-    else
-processRegion:
-    {
-      _LOG.finest("componentType is:{0}", regionType);
-      RegionMetadata rmd =
-        RegionMetadata.getRegionMetadata(getFacesContext());
-      ComponentMetaData cmd = (ComponentMetaData) rmd.getRegionConfig(regionType);
-      if (cmd == null)
-      {
-        _LOG.severe("Could not find metadata for componentType:{0} in region-metadata",
-          regionType);
-        break processRegion;
-      }
-
-      boolean hasErrors = _typeConvertAndDefaultAttrs(regionType, cmd);
-      if (hasErrors)
-        break processRegion;
-
-      String page = cmd.getJspUIDef();
-
-      _LOG.finest("Including page:{0}", page);
-
-      try
-      {
-        if (page != null)
-        {
-          String oldRegion = (String)
-            region.getAttributes().put(_REGION_TYPE_ATTRIBUTE, regionType);
-          if (!regionType.equals(oldRegion))
-          {
-            region.getChildren().clear(); // bug 4508595
-          }
-          pageContext.getRequest().getRequestDispatcher(page).include(
-            pageContext.getRequest(), pageContext.getResponse());
-        }
-        else
-          _LOG.severe("There was no jspUri for componentType:"+regionType);
-      }
-      catch (IOException e)
-      {
-        _LOG.severe(e);
-        throw new JspException(e);
-      }
-      catch (ServletException e)
-      {
-        _LOG.severe(_unwrap(e));
-        throw new JspException(e);
-      }
-    }
-
-    return super.doEndTag();
-  }
-
-  private boolean _typeConvertAndDefaultAttrs(
-    String regionType,
-    ComponentMetaData cmd)
-  {
-    boolean hasErrors = false;
-    UIComponent region = getComponentInstance();
-    Map compAttrs = region.getAttributes();
-    List attrs = cmd.getAttributes();
-    int sz = attrs.size();
-    for(int i=0; i<sz; i++)
-    {
-      AttributeMetaData attr = (AttributeMetaData) attrs.get(i);
-      String name = attr.getAttrName();
-      Class klass = attr.getAttrClass();
-      if (region.getValueBinding(name) != null)
-        continue;
-
-      Object compValue = compAttrs.get(name);
-      if (compValue == null)
-      {
-        // if attribute value was not specified then try to default it:
-        String defaultValue = attr.getDefaultValue();
-        if (defaultValue != null)
-        {
-          hasErrors |= _typeConvert(compAttrs, name, defaultValue, klass);
-        }
-        // if no default value was found then make sure the attribute was not
-        // required:
-        else if (attr.isRequired())
-        {
-          _LOG.severe("attribute:{0} is missing on componentType:{1}",
-                      new Object[] {name, regionType});
-          hasErrors = true;
-        }
-      }
-      // if a value was specified see if it needs to be type converted:
-      else if (compValue instanceof String)
-      {
-        hasErrors |= _typeConvert(compAttrs, name, (String) compValue, klass);
-      }
-    }
-    return hasErrors;
-  }
-
-  private boolean _typeConvert(Map compAttrs, String name, String value, Class klass)
-  {
-    try
-    {
-      Object converted = Coercions.coerce(value, klass);
-      compAttrs.put(name, converted);
-      return false;
-    }
-    catch (IllegalArgumentException e)
-    {
-      _LOG.severe(e);
-    }
-    return true;
-  }
-
-  private static Throwable _unwrap(Throwable t)
-  {
-    while(true)
-    {
-      Throwable causedBy = null;
-      // OC4J does not unwrap the following exceptions:
-      if (t instanceof JspException)
-      {
-        causedBy = ((JspException) t).getRootCause();
-      }
-      else if (t instanceof ServletException)
-      {
-        causedBy = ((ServletException) t).getRootCause();
-      }
-      if ((causedBy == null) || (causedBy == t))
-        return t;
-      else
-        t = causedBy;
-    }
-  }
-
-  private static final class RelocatedFacet implements Serializable
-  {
-    public RelocatedFacet(UIComponent facet, String findComponentId)
-    {
-      _facet = facet;
-      // since we can't serialize the facet UIComponent, we need
-      // another way to retrieve it, in the case that we are
-      // serialized. The solution is to use UIComponent.findComponent if that
-      // happens. So we need the id to pass into findComponent:
-      _findId = findComponentId;
-      assert findComponentId != null;
-    }
-
-    public void restoreFacet(UIComponent region, String facet)
-    {
-      UIComponent relocatedFacet = _facet;
-      if (relocatedFacet == null)
-      {
-        relocatedFacet = region.findComponent(_findId);
-      }
-      region.getFacets().put(facet, relocatedFacet);
-    }
-
-    // must be transient because UIComponent is not Serializable.
-    private transient final UIComponent _facet;
-    private final String _findId;
-  }
-
-  private static final String _REGION_TYPE_ATTRIBUTE =
-    "org.apache.myfaces.adfinternal.taglib.RegionTag.regionType.old";
-  private static final String _RELOCATED_FACETS_ATTRIBUTE =
-    "org.apache.myfaces.adfinternal.taglib.RegionTag.facets.relocated";
-  private static final ADFLogger _LOG = ADFLogger.createADFLogger(ComponentRefTag.class);
+/*
+ * Copyright  2004-2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.adfinternal.taglib;
+
+import java.io.IOException;
+
+import java.io.Serializable;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+
+import javax.servlet.ServletException;
+import javax.servlet.jsp.JspException;
+
+import org.apache.myfaces.adf.logging.ADFLogger;
+import org.apache.myfaces.adf.component.UIXComponentRef;
+
+import org.apache.myfaces.adfinternal.metadata.RegionMetadata;
+import org.apache.myfaces.adfinternal.metadata.RegionMetadata.AttributeMetaData;
+import org.apache.myfaces.adfinternal.metadata.RegionMetadata.ComponentMetaData;
+import org.apache.myfaces.adfinternal.share.expl.Coercions;
+
+
+/**
+ * This tag inserts a region (defined by &lt;af:regionDef&gt;)
+ * into the current page. The "id" attribute is required on this
+ * tag.
+ *
+ * @author The Oracle ADF Faces Team
+ */
+public class ComponentRefTag extends UIXComponentRefTag
+{
+
+
+  public String getComponentType()
+  {
+    return "org.apache.myfaces.adf.ComponentRef";
+  }
+
+  public String getRendererType()
+  {
+    return null;
+  }
+
+  /**
+   * Indicate that a facet was moved. The region component must keep track
+   * of all facets that were moved so that they may be restored before the
+   * jsf jsp tag framework notices. If the jsf jsp tag framework notices
+   * that the facets are missing, it will recreate them, and that is undesireable
+   * as that will break the "binding" attribute support
+   * (on the facet) and will have performance consequences.
+   * @param region the component that the facet was moved from.
+   * @param facet the facet that was moved.
+   * @param component the component that the facet was moved to.
+   */
+  public static void addRelocatedFacet(
+    UIComponent region,
+    String facet,
+    UIComponent component)
+  {
+    Map map = (Map) region.getAttributes().get(_RELOCATED_FACETS_ATTRIBUTE);
+    if (map == null)
+    {
+      map = new HashMap(3);
+      region.getAttributes().put(_RELOCATED_FACETS_ATTRIBUTE, map);
+    }
+
+    // compute the ID to retrieve this relocated facet later.
+    // this is because we don't always have the relocated facet instance
+    // For example, after Serialization, the relocated facet instance is lost:
+    StringBuffer findId = new StringBuffer(component.getId());
+    for(UIComponent c = component.getParent(); c!=region; c = c.getParent())
+    {
+      if (c instanceof NamingContainer)
+      {
+        findId.insert(0, NamingContainer.SEPARATOR_CHAR);
+        findId.insert(0, c.getId());
+      }
+    }
+
+    map.put(facet, new RelocatedFacet(component, findId.toString()));
+  }
+
+  public int doStartTag() throws JspException
+  {
+    int returnVal = super.doStartTag();
+    UIComponent region = getComponentInstance();
+    Map<String,RelocatedFacet> map = (Map) region.getAttributes().get(_RELOCATED_FACETS_ATTRIBUTE);
+    if ((map != null) && (!map.isEmpty()))
+    {
+      // restore all the facets that were moved. Otherwise
+      // the jsf jsp tag framework will recreate them and that will
+      // break support for the "binding" attribute on the facets that were
+      // moved:
+      for(Entry<String,RelocatedFacet> e:map.entrySet())
+      {
+        String facet = e.getKey();
+        RelocatedFacet rf = e.getValue();
+        rf.restoreFacet(region, facet);
+      }
+      map.clear();
+    }
+
+    return returnVal;
+  }
+
+  public int doEndTag() throws JspException
+  {
+    UIXComponentRef region = (UIXComponentRef) getComponentInstance();
+    String regionType = region.getComponentType();
+
+    if (regionType == null)
+    {
+      _LOG.severe("'componentType' attribute is required");
+    }
+    else
+processRegion:
+    {
+      _LOG.finest("componentType is:{0}", regionType);
+      RegionMetadata rmd =
+        RegionMetadata.getRegionMetadata(getFacesContext());
+      ComponentMetaData cmd = (ComponentMetaData) rmd.getRegionConfig(regionType);
+      if (cmd == null)
+      {
+        _LOG.severe("Could not find metadata for componentType:{0} in region-metadata",
+          regionType);
+        break processRegion;
+      }
+
+      boolean hasErrors = _typeConvertAndDefaultAttrs(regionType, cmd);
+      if (hasErrors)
+        break processRegion;
+
+      String page = cmd.getJspUIDef();
+
+      _LOG.finest("Including page:{0}", page);
+
+      try
+      {
+        if (page != null)
+        {
+          String oldRegion = (String)
+            region.getAttributes().put(_REGION_TYPE_ATTRIBUTE, regionType);
+          if (!regionType.equals(oldRegion))
+          {
+            region.getChildren().clear(); // bug 4508595
+          }
+          pageContext.getRequest().getRequestDispatcher(page).include(
+            pageContext.getRequest(), pageContext.getResponse());
+        }
+        else
+          _LOG.severe("There was no jspUri for componentType:"+regionType);
+      }
+      catch (IOException e)
+      {
+        _LOG.severe(e);
+        throw new JspException(e);
+      }
+      catch (ServletException e)
+      {
+        _LOG.severe(_unwrap(e));
+        throw new JspException(e);
+      }
+    }
+
+    return super.doEndTag();
+  }
+
+  private boolean _typeConvertAndDefaultAttrs(
+    String regionType,
+    ComponentMetaData cmd)
+  {
+    boolean hasErrors = false;
+    UIComponent region = getComponentInstance();
+    Map compAttrs = region.getAttributes();
+    List attrs = cmd.getAttributes();
+    int sz = attrs.size();
+    for(int i=0; i<sz; i++)
+    {
+      AttributeMetaData attr = (AttributeMetaData) attrs.get(i);
+      String name = attr.getAttrName();
+      Class klass = attr.getAttrClass();
+      if (region.getValueBinding(name) != null)
+        continue;
+
+      Object compValue = compAttrs.get(name);
+      if (compValue == null)
+      {
+        // if attribute value was not specified then try to default it:
+        String defaultValue = attr.getDefaultValue();
+        if (defaultValue != null)
+        {
+          hasErrors |= _typeConvert(compAttrs, name, defaultValue, klass);
+        }
+        // if no default value was found then make sure the attribute was not
+        // required:
+        else if (attr.isRequired())
+        {
+          _LOG.severe("attribute:{0} is missing on componentType:{1}",
+                      new Object[] {name, regionType});
+          hasErrors = true;
+        }
+      }
+      // if a value was specified see if it needs to be type converted:
+      else if (compValue instanceof String)
+      {
+        hasErrors |= _typeConvert(compAttrs, name, (String) compValue, klass);
+      }
+    }
+    return hasErrors;
+  }
+
+  private boolean _typeConvert(Map compAttrs, String name, String value, Class klass)
+  {
+    try
+    {
+      Object converted = Coercions.coerce(value, klass);
+      compAttrs.put(name, converted);
+      return false;
+    }
+    catch (IllegalArgumentException e)
+    {
+      _LOG.severe(e);
+    }
+    return true;
+  }
+
+  private static Throwable _unwrap(Throwable t)
+  {
+    while(true)
+    {
+      Throwable causedBy = null;
+      // OC4J does not unwrap the following exceptions:
+      if (t instanceof JspException)
+      {
+        causedBy = ((JspException) t).getRootCause();
+      }
+      else if (t instanceof ServletException)
+      {
+        causedBy = ((ServletException) t).getRootCause();
+      }
+      if ((causedBy == null) || (causedBy == t))
+        return t;
+      else
+        t = causedBy;
+    }
+  }
+
+  private static final class RelocatedFacet implements Serializable
+  {
+    public RelocatedFacet(UIComponent facet, String findComponentId)
+    {
+      _facet = facet;
+      // since we can't serialize the facet UIComponent, we need
+      // another way to retrieve it, in the case that we are
+      // serialized. The solution is to use UIComponent.findComponent if that
+      // happens. So we need the id to pass into findComponent:
+      _findId = findComponentId;
+      assert findComponentId != null;
+    }
+
+    public void restoreFacet(UIComponent region, String facet)
+    {
+      UIComponent relocatedFacet = _facet;
+      if (relocatedFacet == null)
+      {
+        relocatedFacet = region.findComponent(_findId);
+      }
+      region.getFacets().put(facet, relocatedFacet);
+    }
+
+    // must be transient because UIComponent is not Serializable.
+    private transient final UIComponent _facet;
+    private final String _findId;
+  }
+
+  private static final String _REGION_TYPE_ATTRIBUTE =
+    "org.apache.myfaces.adfinternal.taglib.RegionTag.regionType.old";
+  private static final String _RELOCATED_FACETS_ATTRIBUTE =
+    "org.apache.myfaces.adfinternal.taglib.RegionTag.facets.relocated";
+  private static final ADFLogger _LOG = ADFLogger.createADFLogger(ComponentRefTag.class);
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ComponentRefTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ValidatorTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ValidatorTag.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ValidatorTag.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ValidatorTag.java Mon Jul 24 21:42:41 2006
@@ -1,159 +1,159 @@
-/*
- * Copyright  2004-2006 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.myfaces.adfinternal.taglib;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-import javax.faces.validator.Validator;
-import javax.faces.webapp.UIComponentTag;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.TagSupport;
-import org.apache.myfaces.adf.logging.ADFLogger;
-
-/**
- * This tag implements a generic validator tag.
- * It adds support for a "binding" attribute as well as a "validatorId"
- *
- * @todo it should be removed after we consume JSF1.2.
- *
- * @author The Oracle ADF Faces Team
- */
-public final class ValidatorTag extends TagSupport
-{
-
-  /**
-   * Sets the validatorId that will be used to find a registered Validator.
-   * This property will be used if there is no
-   * binding on this tag, or if the binding returns null
-   * (in the latter case the Validator instance will be set on the binding).
-   * @param validatorId
-   */
-  public void setValidatorId(String validatorId)
-  {
-    _validatorId = validatorId;
-  }
-
-  /**
-   * if this EL binding expression is set, it will be used to get at a
-   * Validator instance. This expression must be a ValueBinding to a
-   * property that returns a Validator.
-   * @param binding
-   */
-  public void setBinding(String binding)
-  {
-    _binding = binding;
-  }
-
-  public int doStartTag() throws JspException
-  {
-    UIComponentTag tag =
-        UIComponentTag.getParentUIComponentTag(pageContext);
-    if (tag == null)
-    {
-      _LOG.severe("validator tag is not inside a UIComponent.");
-      return SKIP_BODY;
-    }
-
-    // make sure that this UIComponent has just been created:
-    if (tag.getCreated())
-    {
-      // Create and register an instance with the appropriate component
-      Validator validator = createValidator();
-      if (validator != null)
-      {
-        EditableValueHolder evh = (EditableValueHolder) tag.getComponentInstance();
-        evh.addValidator(validator);
-      }
-      else
-      {
-        _LOG.warning("could not create validator for validatorId:{0} and binding:{1}",
-          new String[] {_validatorId, _binding});
-      }
-    }
-
-    return (SKIP_BODY);
-
-  }
-
-  /**
-   * Release state.
-   */
-  public void release()
-  {
-    super.release();
-    _validatorId = null;
-    _binding = null;
-  }
-
-
-  protected Validator createValidator() throws JspException
-  {
-    FacesContext context = FacesContext.getCurrentInstance();
-    final ValueBinding binding;
-    // 1. if there is a binding, then use that to get a Validator instance.
-    if (_binding != null)
-    {
-      binding = context.getApplication().createValueBinding(_binding);
-      Validator validator = (Validator) binding.getValue(context);
-      if (validator != null)
-        return validator;
-    }
-    else
-      binding = null;
-
-    // 2. if there was no binding, or the binding returned null, then use
-    // the validatorId to get at an instance.
-    if (_validatorId != null)
-    {
-      Validator validator =
-        context.getApplication().createValidator(_validatorId);
-      // 3. if there was a binding, then set the Validator instance on the binding.
-      if (binding != null)
-        binding.setValue(context, validator);
-      return validator;
-    }
-    else
-      _LOG.severe("attribute 'validatorId' is missing");
-
-    return null;
-  }
-
-//  private static Throwable _unwrap(Throwable t)
-//  {
-//    while(true)
-//    {
-//      Throwable causedBy = null;
-//      // OC4J does not unwrap the following exceptions:
-//      if (t instanceof JspException)
-//      {
-//        causedBy = ((JspException) t).getRootCause();
-//      }
-//      else if (t instanceof ServletException)
-//      {
-//        causedBy = ((ServletException) t).getRootCause();
-//      }
-//      if ((causedBy == null) || (causedBy == t))
-//        return t;
-//      else
-//        t = causedBy;
-//    }
-//  }
-
-  private String _validatorId = null;
-  private String _binding = null;
-  private static final ADFLogger _LOG = ADFLogger.createADFLogger(ValidatorTag.class);
+/*
+ * Copyright  2004-2006 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.adfinternal.taglib;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.validator.Validator;
+import javax.faces.webapp.UIComponentTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+import org.apache.myfaces.adf.logging.ADFLogger;
+
+/**
+ * This tag implements a generic validator tag.
+ * It adds support for a "binding" attribute as well as a "validatorId"
+ *
+ * @todo it should be removed after we consume JSF1.2.
+ *
+ * @author The Oracle ADF Faces Team
+ */
+public final class ValidatorTag extends TagSupport
+{
+
+  /**
+   * Sets the validatorId that will be used to find a registered Validator.
+   * This property will be used if there is no
+   * binding on this tag, or if the binding returns null
+   * (in the latter case the Validator instance will be set on the binding).
+   * @param validatorId
+   */
+  public void setValidatorId(String validatorId)
+  {
+    _validatorId = validatorId;
+  }
+
+  /**
+   * if this EL binding expression is set, it will be used to get at a
+   * Validator instance. This expression must be a ValueBinding to a
+   * property that returns a Validator.
+   * @param binding
+   */
+  public void setBinding(String binding)
+  {
+    _binding = binding;
+  }
+
+  public int doStartTag() throws JspException
+  {
+    UIComponentTag tag =
+        UIComponentTag.getParentUIComponentTag(pageContext);
+    if (tag == null)
+    {
+      _LOG.severe("validator tag is not inside a UIComponent.");
+      return SKIP_BODY;
+    }
+
+    // make sure that this UIComponent has just been created:
+    if (tag.getCreated())
+    {
+      // Create and register an instance with the appropriate component
+      Validator validator = createValidator();
+      if (validator != null)
+      {
+        EditableValueHolder evh = (EditableValueHolder) tag.getComponentInstance();
+        evh.addValidator(validator);
+      }
+      else
+      {
+        _LOG.warning("could not create validator for validatorId:{0} and binding:{1}",
+          new String[] {_validatorId, _binding});
+      }
+    }
+
+    return (SKIP_BODY);
+
+  }
+
+  /**
+   * Release state.
+   */
+  public void release()
+  {
+    super.release();
+    _validatorId = null;
+    _binding = null;
+  }
+
+
+  protected Validator createValidator() throws JspException
+  {
+    FacesContext context = FacesContext.getCurrentInstance();
+    final ValueBinding binding;
+    // 1. if there is a binding, then use that to get a Validator instance.
+    if (_binding != null)
+    {
+      binding = context.getApplication().createValueBinding(_binding);
+      Validator validator = (Validator) binding.getValue(context);
+      if (validator != null)
+        return validator;
+    }
+    else
+      binding = null;
+
+    // 2. if there was no binding, or the binding returned null, then use
+    // the validatorId to get at an instance.
+    if (_validatorId != null)
+    {
+      Validator validator =
+        context.getApplication().createValidator(_validatorId);
+      // 3. if there was a binding, then set the Validator instance on the binding.
+      if (binding != null)
+        binding.setValue(context, validator);
+      return validator;
+    }
+    else
+      _LOG.severe("attribute 'validatorId' is missing");
+
+    return null;
+  }
+
+//  private static Throwable _unwrap(Throwable t)
+//  {
+//    while(true)
+//    {
+//      Throwable causedBy = null;
+//      // OC4J does not unwrap the following exceptions:
+//      if (t instanceof JspException)
+//      {
+//        causedBy = ((JspException) t).getRootCause();
+//      }
+//      else if (t instanceof ServletException)
+//      {
+//        causedBy = ((ServletException) t).getRootCause();
+//      }
+//      if ((causedBy == null) || (causedBy == t))
+//        return t;
+//      else
+//        t = causedBy;
+//    }
+//  }
+
+  private String _validatorId = null;
+  private String _binding = null;
+  private static final ADFLogger _LOG = ADFLogger.createADFLogger(ValidatorTag.class);
 }

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/taglib/ValidatorTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/LinkRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/LinkRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/LinkRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/LinkRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,40 +13,40 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import org.apache.myfaces.adfinternal.renderkit.AdfRenderingContext;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
-import org.apache.myfaces.adfinternal.ui.UINode;
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-
-/**
- */
-public class LinkRenderer extends org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkRenderer
-{
-  protected Object getStyleClass(
-    RenderingContext context,
-    UINode           node)
-  {
-    Object styleClass = node.getAttributeValue(context, STYLE_CLASS_ATTR);
-    if (styleClass != null)
-      return styleClass;
-
-    if (!LinkUtils.isDefaultStyleClassDisabled(context))
-    {
-      if (isDisabled(context, node))
-        styleClass = LINK_DISABLED_STYLE_CLASS;
-      else
-      {
-        boolean isSelected =  Boolean.TRUE.equals(
-           node.getAttributeValue(context, SELECTED_ATTR));
-        if (isSelected)
-          styleClass = LINK_SELECTED_STYLE_CLASS;
-        else
-          styleClass = LINK_STYLE_CLASS;
-      }
-    }
-
-    return styleClass;
-  }
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import org.apache.myfaces.adfinternal.renderkit.AdfRenderingContext;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
+import org.apache.myfaces.adfinternal.ui.UINode;
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+
+/**
+ */
+public class LinkRenderer extends org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkRenderer
+{
+  protected Object getStyleClass(
+    RenderingContext context,
+    UINode           node)
+  {
+    Object styleClass = node.getAttributeValue(context, STYLE_CLASS_ATTR);
+    if (styleClass != null)
+      return styleClass;
+
+    if (!LinkUtils.isDefaultStyleClassDisabled(context))
+    {
+      if (isDisabled(context, node))
+        styleClass = LINK_DISABLED_STYLE_CLASS;
+      else
+      {
+        boolean isSelected =  Boolean.TRUE.equals(
+           node.getAttributeValue(context, SELECTED_ATTR));
+        if (isSelected)
+          styleClass = LINK_SELECTED_STYLE_CLASS;
+        else
+          styleClass = LINK_STYLE_CLASS;
+      }
+    }
+
+    return styleClass;
+  }
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/LinkRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/MenuListRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/MenuListRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/MenuListRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/MenuListRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,250 +13,250 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import java.io.IOException;
-
-import javax.faces.context.ResponseWriter;
-
-import org.apache.myfaces.adf.component.UIXHierarchy;
-import org.apache.myfaces.adf.component.UIXNavigationLevel;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-import org.apache.myfaces.adfinternal.ui.laf.base.desktop.StyledItemUtils;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.ModelRendererUtils;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
-
-/**
- * Menu List
- * <p>
- * @version   Mar 23, 2005 6:36:14 PM
- * @author The Oracle ADF Faces Team
- *
- */
-public class MenuListRenderer extends XhtmlLafRenderer
-{
-
-   protected void prerender(
-    RenderingContext context,
-    UINode           node
-  )throws IOException
-  {
-
-    super.prerender( context, node);
-    UINode labelChild = getNamedChild(context, node, LABEL_CHILD);
-
-    // render the label child, render it before you change any properties!
-    // Ex:
-    //   1. One
-    //   2. Two
-    //      a. A
-    //   3. Three
-    // In the example above "Two" would be the label child and appears to be
-    // part of the numbered list
-    if ( labelChild != null )
-    {
-      ResponseWriter writer = context.getResponseWriter();
-      writer.startElement( SPAN_ELEMENT, null );
-      labelChild.render(context);
-      writer.endElement(SPAN_ELEMENT);
-    }
-
-
-    // set the selected property to false
-    StyledItemUtils.setSelected(context, false);
-
-
-    ResponseWriter writer = context.getResponseWriter();
-
-
-    String style = PdaHtmlLafUtils.getStringAttributeValue(context,
-                                                     node,
-                                                     LIST_STYLE_ATTR);
-    if (LIST_STYLE_LOWER_ALPHA.equals(style) ||
-        LIST_STYLE_UPPER_ALPHA.equals(style) ||
-        LIST_STYLE_DECIMAL.equals(style)
-    )
-    {
-      writer.startElement( "ol", node.getUIComponent() );
-      super.renderAttributes(context, node);
-      XhtmlLafRenderer.renderStyleClassAttribute(context, STYLED_LIST_STYLE_CLASS);
-
-      if ( LIST_STYLE_LOWER_ALPHA.equals(style))
-        style = _LOWER_ALPHA;
-      else if (LIST_STYLE_UPPER_ALPHA.equals(style))
-        style = _UPPER_ALPHA;
-
-      writer.writeAttribute( STYLE_ATTRIBUTE,  _LIST_STYLE_TYPE + style, null);
-    }
-    else
-    {
-      writer.startElement( "ul", node.getUIComponent() );
-      super.renderAttributes(context, node);
-      XhtmlLafRenderer.renderStyleClassAttribute(context, STYLED_LIST_STYLE_CLASS);
-
-      StringBuffer inlineStyleBuffer = null;
-
-
-      if (style != null )
-      {
-        inlineStyleBuffer = new StringBuffer( _LIST_STYLE_TYPE.length() +
-                                              style.length());
-        inlineStyleBuffer.append(_LIST_STYLE_TYPE).append(style);
-
-      }
-
-      if ( inlineStyleBuffer != null && inlineStyleBuffer.length() > 0 )
-        writer.writeAttribute("style", inlineStyleBuffer.toString(), null);
-    }
-  }
-
-
-  protected UIXHierarchy getHierarchyBase(
-    RenderingContext context,
-    UINode           node
-  )
-  {
-    return (UIXHierarchy) node.getUIComponent();
-  }
-
-
-  protected UINode getStamp(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    return node.getNamedChild(context, NODE_STAMP_CHILD);
-  }
-
-
-  protected boolean setNewPath(
-    RenderingContext context,
-    UINode           node,
-    UIXHierarchy    component
-  )
-  {
-    int startDepth = getIntAttributeValue(context, node, LEVEL_ATTR, 0);
-    return ModelRendererUtils.setNewPath(component, startDepth,
-                                         ((UIXNavigationLevel)component).getFocusRowKey());
-
-
-  }
-
-  protected void renderContent(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-
-    UIXHierarchy component = getHierarchyBase(context, node);
-    UINode stamp = getStamp(context, node);
-
-    if(stamp != null)
-    {
-
-      // Save the current key
-      Object oldPath = component.getRowKey();
-      boolean isNewPath = setNewPath(context, node, component);
-      if (isNewPath)
-      {
-
-        int size = component.getRowCount();
-        int rowIndex = component.getRowIndex();
-
-        for (int i = 0; i < size; i++)
-        {
-          component.setRowIndex(i);
-          renderNode(context, stamp,i == rowIndex);
-        }
-
-        // Restore the old path
-        component.setRowKey(oldPath);
-      }
-    }
-
-    super.renderContent(context, node);
-  }
-
-
-  protected void postrender(
-    RenderingContext context,
-    UINode           node
-  )throws IOException
-  {
-    ResponseWriter writer = context.getFacesContext().getResponseWriter();
-
-    String style = PdaHtmlLafUtils.getStringAttributeValue(context,
-                                                     node,
-                                                     LIST_STYLE_ATTR);
-    if (LIST_STYLE_LOWER_ALPHA.equals(style) ||
-        LIST_STYLE_UPPER_ALPHA.equals(style) ||
-        LIST_STYLE_DECIMAL.equals(style)
-    )
-    {
-      writer.endElement("ol");
-    }
-    else
-    {
-      writer.endElement("ul");
-    }
-    super.postrender( context, node);
-  }
-
-  protected void renderIndexedChild(
-    RenderingContext context,
-    UINode           node,
-    int              childIndex
-    ) throws IOException
-  {
-
-    UINode child = node.getIndexedChild(context, childIndex);
-    boolean selected = isSelected(context, child);
-
-    renderNode(context, child, selected);
-  }
-
-  protected void renderNode(
-    RenderingContext context,
-    UINode           node,
-    boolean          selected
-    ) throws IOException
-  {
-    if (selected )
-    {
-      // set the selected property to true
-      StyledItemUtils.setSelected(context, true);
-    }
-
-    ResponseWriter writer = context.getResponseWriter();
-    writer.startElement( LIST_ITEM_ELEMENT, null );
-    writer.startElement(SPAN_ELEMENT, null);
-    if ( StyledItemUtils.isSelected(context, node) )
-      renderStyleClassAttribute(context, AF_MENU_LIST_SELECTED_STYLE_CLASS);
-    else
-      renderStyleClassAttribute(context, AF_MENU_LIST_STYLE_CLASS);
-
-    boolean initialLinkSelectedStatus = LinkUtils.isSelected(context);
-
-    node.render(context);
-
-    //Reset the selected status, which might have been changed on rendering
-    //  indexed children.
-    LinkUtils.setSelected(context, initialLinkSelectedStatus);
-
-    writer.endElement(SPAN_ELEMENT);
-    writer.endElement( LIST_ITEM_ELEMENT );
-
-    // set the selected property to false
-    StyledItemUtils.setSelected(context, false);
-  }
-
-
-
-  private static final String _LIST_STYLE_TYPE = "list-style-type:";
-  private static final String _LOWER_ALPHA = "lower-alpha";
-  private static final String _UPPER_ALPHA = "upper-alpha";
-
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import java.io.IOException;
+
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.adf.component.UIXHierarchy;
+import org.apache.myfaces.adf.component.UIXNavigationLevel;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+import org.apache.myfaces.adfinternal.ui.laf.base.desktop.StyledItemUtils;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.ModelRendererUtils;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
+
+/**
+ * Menu List
+ * <p>
+ * @version   Mar 23, 2005 6:36:14 PM
+ * @author The Oracle ADF Faces Team
+ *
+ */
+public class MenuListRenderer extends XhtmlLafRenderer
+{
+
+   protected void prerender(
+    RenderingContext context,
+    UINode           node
+  )throws IOException
+  {
+
+    super.prerender( context, node);
+    UINode labelChild = getNamedChild(context, node, LABEL_CHILD);
+
+    // render the label child, render it before you change any properties!
+    // Ex:
+    //   1. One
+    //   2. Two
+    //      a. A
+    //   3. Three
+    // In the example above "Two" would be the label child and appears to be
+    // part of the numbered list
+    if ( labelChild != null )
+    {
+      ResponseWriter writer = context.getResponseWriter();
+      writer.startElement( SPAN_ELEMENT, null );
+      labelChild.render(context);
+      writer.endElement(SPAN_ELEMENT);
+    }
+
+
+    // set the selected property to false
+    StyledItemUtils.setSelected(context, false);
+
+
+    ResponseWriter writer = context.getResponseWriter();
+
+
+    String style = PdaHtmlLafUtils.getStringAttributeValue(context,
+                                                     node,
+                                                     LIST_STYLE_ATTR);
+    if (LIST_STYLE_LOWER_ALPHA.equals(style) ||
+        LIST_STYLE_UPPER_ALPHA.equals(style) ||
+        LIST_STYLE_DECIMAL.equals(style)
+    )
+    {
+      writer.startElement( "ol", node.getUIComponent() );
+      super.renderAttributes(context, node);
+      XhtmlLafRenderer.renderStyleClassAttribute(context, STYLED_LIST_STYLE_CLASS);
+
+      if ( LIST_STYLE_LOWER_ALPHA.equals(style))
+        style = _LOWER_ALPHA;
+      else if (LIST_STYLE_UPPER_ALPHA.equals(style))
+        style = _UPPER_ALPHA;
+
+      writer.writeAttribute( STYLE_ATTRIBUTE,  _LIST_STYLE_TYPE + style, null);
+    }
+    else
+    {
+      writer.startElement( "ul", node.getUIComponent() );
+      super.renderAttributes(context, node);
+      XhtmlLafRenderer.renderStyleClassAttribute(context, STYLED_LIST_STYLE_CLASS);
+
+      StringBuffer inlineStyleBuffer = null;
+
+
+      if (style != null )
+      {
+        inlineStyleBuffer = new StringBuffer( _LIST_STYLE_TYPE.length() +
+                                              style.length());
+        inlineStyleBuffer.append(_LIST_STYLE_TYPE).append(style);
+
+      }
+
+      if ( inlineStyleBuffer != null && inlineStyleBuffer.length() > 0 )
+        writer.writeAttribute("style", inlineStyleBuffer.toString(), null);
+    }
+  }
+
+
+  protected UIXHierarchy getHierarchyBase(
+    RenderingContext context,
+    UINode           node
+  )
+  {
+    return (UIXHierarchy) node.getUIComponent();
+  }
+
+
+  protected UINode getStamp(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    return node.getNamedChild(context, NODE_STAMP_CHILD);
+  }
+
+
+  protected boolean setNewPath(
+    RenderingContext context,
+    UINode           node,
+    UIXHierarchy    component
+  )
+  {
+    int startDepth = getIntAttributeValue(context, node, LEVEL_ATTR, 0);
+    return ModelRendererUtils.setNewPath(component, startDepth,
+                                         ((UIXNavigationLevel)component).getFocusRowKey());
+
+
+  }
+
+  protected void renderContent(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+
+    UIXHierarchy component = getHierarchyBase(context, node);
+    UINode stamp = getStamp(context, node);
+
+    if(stamp != null)
+    {
+
+      // Save the current key
+      Object oldPath = component.getRowKey();
+      boolean isNewPath = setNewPath(context, node, component);
+      if (isNewPath)
+      {
+
+        int size = component.getRowCount();
+        int rowIndex = component.getRowIndex();
+
+        for (int i = 0; i < size; i++)
+        {
+          component.setRowIndex(i);
+          renderNode(context, stamp,i == rowIndex);
+        }
+
+        // Restore the old path
+        component.setRowKey(oldPath);
+      }
+    }
+
+    super.renderContent(context, node);
+  }
+
+
+  protected void postrender(
+    RenderingContext context,
+    UINode           node
+  )throws IOException
+  {
+    ResponseWriter writer = context.getFacesContext().getResponseWriter();
+
+    String style = PdaHtmlLafUtils.getStringAttributeValue(context,
+                                                     node,
+                                                     LIST_STYLE_ATTR);
+    if (LIST_STYLE_LOWER_ALPHA.equals(style) ||
+        LIST_STYLE_UPPER_ALPHA.equals(style) ||
+        LIST_STYLE_DECIMAL.equals(style)
+    )
+    {
+      writer.endElement("ol");
+    }
+    else
+    {
+      writer.endElement("ul");
+    }
+    super.postrender( context, node);
+  }
+
+  protected void renderIndexedChild(
+    RenderingContext context,
+    UINode           node,
+    int              childIndex
+    ) throws IOException
+  {
+
+    UINode child = node.getIndexedChild(context, childIndex);
+    boolean selected = isSelected(context, child);
+
+    renderNode(context, child, selected);
+  }
+
+  protected void renderNode(
+    RenderingContext context,
+    UINode           node,
+    boolean          selected
+    ) throws IOException
+  {
+    if (selected )
+    {
+      // set the selected property to true
+      StyledItemUtils.setSelected(context, true);
+    }
+
+    ResponseWriter writer = context.getResponseWriter();
+    writer.startElement( LIST_ITEM_ELEMENT, null );
+    writer.startElement(SPAN_ELEMENT, null);
+    if ( StyledItemUtils.isSelected(context, node) )
+      renderStyleClassAttribute(context, AF_MENU_LIST_SELECTED_STYLE_CLASS);
+    else
+      renderStyleClassAttribute(context, AF_MENU_LIST_STYLE_CLASS);
+
+    boolean initialLinkSelectedStatus = LinkUtils.isSelected(context);
+
+    node.render(context);
+
+    //Reset the selected status, which might have been changed on rendering
+    //  indexed children.
+    LinkUtils.setSelected(context, initialLinkSelectedStatus);
+
+    writer.endElement(SPAN_ELEMENT);
+    writer.endElement( LIST_ITEM_ELEMENT );
+
+    // set the selected property to false
+    StyledItemUtils.setSelected(context, false);
+  }
+
+
+
+  private static final String _LIST_STYLE_TYPE = "list-style-type:";
+  private static final String _LOWER_ALPHA = "lower-alpha";
+  private static final String _UPPER_ALPHA = "upper-alpha";
+
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/MenuListRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowItemRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowItemRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowItemRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowItemRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,64 +13,64 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import java.io.IOException;
-
-import org.apache.myfaces.adfinternal.share.url.URLEncoder;
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-import org.apache.myfaces.adfinternal.ui.laf.base.BaseLafUtils;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.FormValueRenderer;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkRenderer;
-
-/**
- */
-public class ShowItemRenderer extends LinkRenderer
-{
-  protected void renderIndexedChild(
-    RenderingContext context,
-    UINode           node,
-    int              currVisChildIndex,
-    int              prevVisChildIndex,
-    int              nextVisChildIndex,
-    int              ithRenderedChild
-    ) throws IOException
-  {
-    //  Do nothing here, my parent will take care of rendering my children
-    //  if I have my 'selected' attribute set to true.
-  }
-
-  // Returns the partial change script that is usually rendered for onClick
-  protected String getPartialChangeScript(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    /*String partialTargets = getAncestorPartialTargets(context);
-
-    if (partialTargets == null)
-      return null;
-    */
-
-    URLEncoder encoder = context.getURLEncoder();
-    //String partialTargetsKey = encoder.encodeParameter(PARTIAL_TARGETS_PARAM);
-    String eventParamKey = encoder.encodeParameter(EVENT_PARAM);
-    String sourceParamKey = encoder.encodeParameter(SOURCE_PARAM);
-    String sourceParam = BaseLafUtils.getStringAttributeValue(
-      context, node, ID_ATTR);
-
-    String formName = getFormName(context, node);
-
-    String partialChangeScript =
-      "submitForm ('" + formName + "',0,{"+
-      eventParamKey + ":'" + SHOW_EVENT + "'," +
-      sourceParamKey + ":'" + sourceParam + "'});return false";
-
-    //    String partialKey = context.getURLEncoder().encodeParameter(PARTIAL_PARAM);
-    FormValueRenderer.addNeededValue(context, formName, eventParamKey,
-                                      sourceParamKey, null,null);
-
-    return partialChangeScript;
-  }
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import java.io.IOException;
+
+import org.apache.myfaces.adfinternal.share.url.URLEncoder;
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+import org.apache.myfaces.adfinternal.ui.laf.base.BaseLafUtils;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.FormValueRenderer;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkRenderer;
+
+/**
+ */
+public class ShowItemRenderer extends LinkRenderer
+{
+  protected void renderIndexedChild(
+    RenderingContext context,
+    UINode           node,
+    int              currVisChildIndex,
+    int              prevVisChildIndex,
+    int              nextVisChildIndex,
+    int              ithRenderedChild
+    ) throws IOException
+  {
+    //  Do nothing here, my parent will take care of rendering my children
+    //  if I have my 'selected' attribute set to true.
+  }
+
+  // Returns the partial change script that is usually rendered for onClick
+  protected String getPartialChangeScript(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    /*String partialTargets = getAncestorPartialTargets(context);
+
+    if (partialTargets == null)
+      return null;
+    */
+
+    URLEncoder encoder = context.getURLEncoder();
+    //String partialTargetsKey = encoder.encodeParameter(PARTIAL_TARGETS_PARAM);
+    String eventParamKey = encoder.encodeParameter(EVENT_PARAM);
+    String sourceParamKey = encoder.encodeParameter(SOURCE_PARAM);
+    String sourceParam = BaseLafUtils.getStringAttributeValue(
+      context, node, ID_ATTR);
+
+    String formName = getFormName(context, node);
+
+    String partialChangeScript =
+      "submitForm ('" + formName + "',0,{"+
+      eventParamKey + ":'" + SHOW_EVENT + "'," +
+      sourceParamKey + ":'" + sourceParam + "'});return false";
+
+    //    String partialKey = context.getURLEncoder().encodeParameter(PARTIAL_PARAM);
+    FormValueRenderer.addNeededValue(context, formName, eventParamKey,
+                                      sourceParamKey, null,null);
+
+    return partialChangeScript;
+  }
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowItemRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowOneTabRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowOneTabRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowOneTabRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowOneTabRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,144 +13,144 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import javax.faces.context.ResponseWriter;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-import org.apache.myfaces.adfinternal.ui.Renderer;
-import org.apache.myfaces.adfinternal.ui.partial.PartialPageRendererUtils;
-
-import java.io.IOException;
-
-/**
- */
-public class ShowOneTabRenderer extends org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer
-{
-  protected String getElementName(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    return SPAN_ELEMENT;
-  }
-
-  protected void prerender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    super.prerender(context, node);
-    
-    // Check for partial targets
-    Object id = getID(context, node);
-    String partialTargets = getEncodedPartialTargets(context, node, id);
-    setPartialTargets(context, partialTargets);
-    Object position = node.getAttributeValue(context, POSITION_ATTR);
-    if (!POSITION_BELOW.equals(position))
-    {
-      SubTabBarUtils.setSelectedIndex(
-                        context,
-                        new Integer(_getResolvedSelectedIndex(context, node)));
-      Renderer subTabBarRenderer =
-          context.getRendererManager().getRenderer(
-                               MARLIN_NAMESPACE, SUB_TAB_BAR_NAME);
-      subTabBarRenderer.render(context, node);
-    }
-  }
-  
-  protected void renderContent(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    ResponseWriter writer = context.getResponseWriter();
-    writer.startElement( DIV_ELEMENT, null );
-    renderStyleClassAttribute(context,
-                              AF_SHOW_ONE_TAB_BODY_STYLE_CLASS);
-    int selectedChildIndex = _getResolvedSelectedIndex(context, node);
-    //Render the content for the selected showItem
-    if (selectedChildIndex != -1)
-      super.renderContent(
-             context, node.getIndexedChild(context, selectedChildIndex));
-    writer.endElement( DIV_ELEMENT );
-  }
-
-  protected void postrender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    Object position = node.getAttributeValue(context, POSITION_ATTR);
-    if (POSITION_BELOW.equals(position))
-    {
-      Renderer subTabBarRenderer =
-        context.getRendererManager().getRenderer(
-                            MARLIN_NAMESPACE, SUB_TAB_BAR_NAME);
-      subTabBarRenderer.render(context, node);
-    }
-    
-    setPartialTargets(context, null);
-    super.postrender(context, node);
-  }
-
-  // Returns the partial targets for this node, if any,
-  // in encoded form.
-  protected static String getEncodedPartialTargets(
-    RenderingContext context,
-    UINode           node,
-    Object           id
-    )
-  {
-    String[] partialTargets = PdaHtmlLafUtils.getPartialTargets(context, node, id);
-    return PartialPageRendererUtils.encodePartialTargets(partialTargets);
-  }
-
-  // Sets the partial targets on the RenderingContext
-  protected static void setPartialTargets(
-    RenderingContext context,
-    String           partialTargets)
-  {
-    context.setProperty(MARLIN_NAMESPACE,
-            PdaHtmlLafConstants.LINK_CONTAINER_PARTIAL_TARGETS_PROPERTY,
-                        partialTargets);
-  }
-
-  /**
-   * Returns the index of the first avilable showItem child that has its
-   *  'selected' property set to true.
-   * If none of children are selected, the index of first such child that is
-   *  enabled is returned.
-   * Returns -1 if both of these fail.
-   *
-   * @todo pudupa: XhtmlLafRenderer.getResolvedSelectedIndex() is not a clear
-   *   reusable code for 3.0, consolidate for code reuse at a later stage when
-   *   the selection model (whether parent has this info or the children) is clear.
-   */
-  private static int _getResolvedSelectedIndex(
-    RenderingContext context,
-    UINode parentNode)
-  {
-    int childCount = parentNode.getIndexedChildCount(context);
-    int firstEnabledChildIndex = -1;
-    for (int childIndex=0; childIndex<childCount; childIndex++)
-    {
-      UINode childNode = parentNode.getIndexedChild(context, childIndex);
-      
-      if (Boolean.TRUE.equals(
-            childNode.getAttributeValue(context, DISCLOSED_ATTR)))
-      {
-        return childIndex;
-      }
-      if (firstEnabledChildIndex == -1  &&
-          !Boolean.TRUE.equals(
-              childNode.getAttributeValue(context, DISABLED_ATTR)))
-      {
-        firstEnabledChildIndex = childIndex;
-      }
-    }
-
-    return firstEnabledChildIndex;
-  }
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+import org.apache.myfaces.adfinternal.ui.Renderer;
+import org.apache.myfaces.adfinternal.ui.partial.PartialPageRendererUtils;
+
+import java.io.IOException;
+
+/**
+ */
+public class ShowOneTabRenderer extends org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer
+{
+  protected String getElementName(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    return SPAN_ELEMENT;
+  }
+
+  protected void prerender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    super.prerender(context, node);
+    
+    // Check for partial targets
+    Object id = getID(context, node);
+    String partialTargets = getEncodedPartialTargets(context, node, id);
+    setPartialTargets(context, partialTargets);
+    Object position = node.getAttributeValue(context, POSITION_ATTR);
+    if (!POSITION_BELOW.equals(position))
+    {
+      SubTabBarUtils.setSelectedIndex(
+                        context,
+                        new Integer(_getResolvedSelectedIndex(context, node)));
+      Renderer subTabBarRenderer =
+          context.getRendererManager().getRenderer(
+                               MARLIN_NAMESPACE, SUB_TAB_BAR_NAME);
+      subTabBarRenderer.render(context, node);
+    }
+  }
+  
+  protected void renderContent(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    ResponseWriter writer = context.getResponseWriter();
+    writer.startElement( DIV_ELEMENT, null );
+    renderStyleClassAttribute(context,
+                              AF_SHOW_ONE_TAB_BODY_STYLE_CLASS);
+    int selectedChildIndex = _getResolvedSelectedIndex(context, node);
+    //Render the content for the selected showItem
+    if (selectedChildIndex != -1)
+      super.renderContent(
+             context, node.getIndexedChild(context, selectedChildIndex));
+    writer.endElement( DIV_ELEMENT );
+  }
+
+  protected void postrender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    Object position = node.getAttributeValue(context, POSITION_ATTR);
+    if (POSITION_BELOW.equals(position))
+    {
+      Renderer subTabBarRenderer =
+        context.getRendererManager().getRenderer(
+                            MARLIN_NAMESPACE, SUB_TAB_BAR_NAME);
+      subTabBarRenderer.render(context, node);
+    }
+    
+    setPartialTargets(context, null);
+    super.postrender(context, node);
+  }
+
+  // Returns the partial targets for this node, if any,
+  // in encoded form.
+  protected static String getEncodedPartialTargets(
+    RenderingContext context,
+    UINode           node,
+    Object           id
+    )
+  {
+    String[] partialTargets = PdaHtmlLafUtils.getPartialTargets(context, node, id);
+    return PartialPageRendererUtils.encodePartialTargets(partialTargets);
+  }
+
+  // Sets the partial targets on the RenderingContext
+  protected static void setPartialTargets(
+    RenderingContext context,
+    String           partialTargets)
+  {
+    context.setProperty(MARLIN_NAMESPACE,
+            PdaHtmlLafConstants.LINK_CONTAINER_PARTIAL_TARGETS_PROPERTY,
+                        partialTargets);
+  }
+
+  /**
+   * Returns the index of the first avilable showItem child that has its
+   *  'selected' property set to true.
+   * If none of children are selected, the index of first such child that is
+   *  enabled is returned.
+   * Returns -1 if both of these fail.
+   *
+   * @todo pudupa: XhtmlLafRenderer.getResolvedSelectedIndex() is not a clear
+   *   reusable code for 3.0, consolidate for code reuse at a later stage when
+   *   the selection model (whether parent has this info or the children) is clear.
+   */
+  private static int _getResolvedSelectedIndex(
+    RenderingContext context,
+    UINode parentNode)
+  {
+    int childCount = parentNode.getIndexedChildCount(context);
+    int firstEnabledChildIndex = -1;
+    for (int childIndex=0; childIndex<childCount; childIndex++)
+    {
+      UINode childNode = parentNode.getIndexedChild(context, childIndex);
+      
+      if (Boolean.TRUE.equals(
+            childNode.getAttributeValue(context, DISCLOSED_ATTR)))
+      {
+        return childIndex;
+      }
+      if (firstEnabledChildIndex == -1  &&
+          !Boolean.TRUE.equals(
+              childNode.getAttributeValue(context, DISABLED_ATTR)))
+      {
+        firstEnabledChildIndex = childIndex;
+      }
+    }
+
+    return firstEnabledChildIndex;
+  }
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/ShowOneTabRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,148 +13,148 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import javax.faces.context.ResponseWriter;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-import org.apache.myfaces.adfinternal.ui.Renderer;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
-
-import java.io.IOException;
-
-/**
-*/
-public class SubTabBarRenderer extends XhtmlLafRenderer
-{
-  protected String getElementName(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    return DIV_ELEMENT ;
-  }
-
-  protected void renderID(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    // Do not render id for the individual tab bars. The overall 3.0 component
-    //  is the showOneTab (a combination of subTabLayout and subTabBar from 2.2)
-    //  We will render id once on the top most html element i.e. <span>
-  }
-
-  protected void renderAttributes(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    super.renderAttributes(context, node);
-  }
-
-  protected void prerender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    super.prerender(context, node);
-
-    // Disable default link style classes - subTabBar items
-    // don't need to render the default OraLink style class.
-    LinkUtils.startDefaultStyleClassDisabled(context);
-  }
-
-  protected void postrender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    // Re-enable default link style classes
-    LinkUtils.endDefaultStyleClassDisabled(context);
-    super.postrender(context, node);
-  }
-
-  /**
-   * Overrride to render in three passes.
-   */
-  protected void renderContent(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    // save the inital stauts
-    boolean actualLinkStatus = LinkUtils.isSelected(context);
-    ResponseWriter writer = context.getResponseWriter();
-
-    LinkRenderer.setSaveModelDisabled(context, true);
-
-    Integer selectedIndex = (Integer)SubTabBarUtils.getSelectedIndex(context);
-
-    // save away the selected index
-    context.setLocalProperty( _SELECTED_NODE_KEY, selectedIndex);
-
-    // render pass 1 - row with rendered children
-    writer.startElement(DIV_ELEMENT, null);
-    super.renderContent(context, node);
-    writer.endElement(DIV_ELEMENT);
-    LinkRenderer.setSaveModelDisabled(context, false);
-    // restore it back to original status
-    LinkUtils.setSelected(context,actualLinkStatus);
-  }
-
-
-
-  protected void renderIndexedChild(
-    RenderingContext context,
-    UINode           node,
-    int              currVisChildIndex,
-    int              prevVisChildIndex,
-    int              nextVisChildIndex,
-    int              ithRenderedChild
-    ) throws IOException
-  {
-    UINode currVisChild = node.getIndexedChild(context, currVisChildIndex);
-    ResponseWriter writer = context.getResponseWriter();
-    // get the selected index
-    int selectedIndex = ((Integer)context.getLocalProperty( 0,
-                                                            _SELECTED_NODE_KEY,
-                                                            ZERO)).intValue();
-    boolean isSelected = (currVisChildIndex == selectedIndex);
-    //
-    // output the link
-    //
-    try
-    {
-      context.pushChild(currVisChild, null, currVisChildIndex);
-      context.pushRenderedChild(context, currVisChild);
-      writer.startElement( SPAN_ELEMENT, null);
-      writer.writeAttribute( NOWRAP_ATTRIBUTE,
-                             Boolean.TRUE,
-                             null);
-      renderStyleClassAttribute(context,
-                                isSelected ?
-                                AF_SHOW_ONE_TAB_SELECTED_STYLE_CLASS : 
-                                AF_SHOW_ONE_TAB_STYLE_CLASS);
-      renderSpacer( context, 5, 1 );
-      // Store the status of Link selection - used in LinkRenderer
-      LinkUtils.setSelected(context,isSelected);
-      Renderer renderer = context.getRendererManager().getRenderer(
-            MARLIN_NAMESPACE, SHOW_ITEM_NAME);
-          renderer.render(context, currVisChild);
-      //currVisChild.render(context);
-      renderSpacer( context, 5, 1 );
-      writer.endElement( SPAN_ELEMENT);
-    }
-    finally
-    {
-      context.popRenderedChild(context);
-      context.popChild();
-    }
-  }
-
-  // key of the selected node
-  private static final Object _SELECTED_NODE_KEY = new Object();
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+import org.apache.myfaces.adfinternal.ui.Renderer;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.LinkUtils;
+
+import java.io.IOException;
+
+/**
+*/
+public class SubTabBarRenderer extends XhtmlLafRenderer
+{
+  protected String getElementName(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    return DIV_ELEMENT ;
+  }
+
+  protected void renderID(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    // Do not render id for the individual tab bars. The overall 3.0 component
+    //  is the showOneTab (a combination of subTabLayout and subTabBar from 2.2)
+    //  We will render id once on the top most html element i.e. <span>
+  }
+
+  protected void renderAttributes(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    super.renderAttributes(context, node);
+  }
+
+  protected void prerender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    super.prerender(context, node);
+
+    // Disable default link style classes - subTabBar items
+    // don't need to render the default OraLink style class.
+    LinkUtils.startDefaultStyleClassDisabled(context);
+  }
+
+  protected void postrender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    // Re-enable default link style classes
+    LinkUtils.endDefaultStyleClassDisabled(context);
+    super.postrender(context, node);
+  }
+
+  /**
+   * Overrride to render in three passes.
+   */
+  protected void renderContent(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    // save the inital stauts
+    boolean actualLinkStatus = LinkUtils.isSelected(context);
+    ResponseWriter writer = context.getResponseWriter();
+
+    LinkRenderer.setSaveModelDisabled(context, true);
+
+    Integer selectedIndex = (Integer)SubTabBarUtils.getSelectedIndex(context);
+
+    // save away the selected index
+    context.setLocalProperty( _SELECTED_NODE_KEY, selectedIndex);
+
+    // render pass 1 - row with rendered children
+    writer.startElement(DIV_ELEMENT, null);
+    super.renderContent(context, node);
+    writer.endElement(DIV_ELEMENT);
+    LinkRenderer.setSaveModelDisabled(context, false);
+    // restore it back to original status
+    LinkUtils.setSelected(context,actualLinkStatus);
+  }
+
+
+
+  protected void renderIndexedChild(
+    RenderingContext context,
+    UINode           node,
+    int              currVisChildIndex,
+    int              prevVisChildIndex,
+    int              nextVisChildIndex,
+    int              ithRenderedChild
+    ) throws IOException
+  {
+    UINode currVisChild = node.getIndexedChild(context, currVisChildIndex);
+    ResponseWriter writer = context.getResponseWriter();
+    // get the selected index
+    int selectedIndex = ((Integer)context.getLocalProperty( 0,
+                                                            _SELECTED_NODE_KEY,
+                                                            ZERO)).intValue();
+    boolean isSelected = (currVisChildIndex == selectedIndex);
+    //
+    // output the link
+    //
+    try
+    {
+      context.pushChild(currVisChild, null, currVisChildIndex);
+      context.pushRenderedChild(context, currVisChild);
+      writer.startElement( SPAN_ELEMENT, null);
+      writer.writeAttribute( NOWRAP_ATTRIBUTE,
+                             Boolean.TRUE,
+                             null);
+      renderStyleClassAttribute(context,
+                                isSelected ?
+                                AF_SHOW_ONE_TAB_SELECTED_STYLE_CLASS : 
+                                AF_SHOW_ONE_TAB_STYLE_CLASS);
+      renderSpacer( context, 5, 1 );
+      // Store the status of Link selection - used in LinkRenderer
+      LinkUtils.setSelected(context,isSelected);
+      Renderer renderer = context.getRendererManager().getRenderer(
+            MARLIN_NAMESPACE, SHOW_ITEM_NAME);
+          renderer.render(context, currVisChild);
+      //currVisChild.render(context);
+      renderSpacer( context, 5, 1 );
+      writer.endElement( SPAN_ELEMENT);
+    }
+    finally
+    {
+      context.popRenderedChild(context);
+      context.popChild();
+    }
+  }
+
+  // key of the selected node
+  private static final Object _SELECTED_NODE_KEY = new Object();
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarUtils.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarUtils.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarUtils.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarUtils.java Mon Jul 24 21:42:41 2006
@@ -13,31 +13,31 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UIConstants;
-
-/**
- */
-public class SubTabBarUtils implements UIConstants
-{
-  public static Object getSelectedIndex(
-    RenderingContext context
-    )
-  {
-    return context.getProperty( MARLIN_NAMESPACE,
-                                _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY);
-  }
-  
-  public static void setSelectedIndex(
-    RenderingContext context,
-    Object selectedIndex)
-  {
-    context.setProperty( MARLIN_NAMESPACE,
-                         _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY,
-                         selectedIndex);
-  }
-
-  private static final Object _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY = new Object();
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UIConstants;
+
+/**
+ */
+public class SubTabBarUtils implements UIConstants
+{
+  public static Object getSelectedIndex(
+    RenderingContext context
+    )
+  {
+    return context.getProperty( MARLIN_NAMESPACE,
+                                _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY);
+  }
+  
+  public static void setSelectedIndex(
+    RenderingContext context,
+    Object selectedIndex)
+  {
+    context.setProperty( MARLIN_NAMESPACE,
+                         _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY,
+                         selectedIndex);
+  }
+
+  private static final Object _SUB_TAB_BAR_SELECTED_INDEX_PROPERTY = new Object();
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/SubTabBarUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/TipRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/TipRenderer.java?rev=425276&r1=425275&r2=425276&view=diff
==============================================================================
--- incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/TipRenderer.java (original)
+++ incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/TipRenderer.java Mon Jul 24 21:42:41 2006
@@ -13,80 +13,80 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-package org.apache.myfaces.adfinternal.ui.laf.base.pda;
-
-import javax.faces.context.ResponseWriter;
-
-import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
-
-import org.apache.myfaces.adfinternal.ui.RenderingContext;
-import org.apache.myfaces.adfinternal.ui.UINode;
-
-import java.io.IOException;
-
-/**
- */
-public class TipRenderer extends XhtmlLafRenderer
-{
-  protected void renderAttributes(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    super.renderAttributes(context, node);
-  }
-
-  protected void prerender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    super.prerender(context, node);
-
-    ResponseWriter writer = context.getResponseWriter();
-    // tip icon
-    writer.startElement("span", null);
-    renderIcon(context, "tip.gif", "15", "13");
-    writer.endElement("span");
-
-    // tip label
-    writer.startElement("span", null);
-    renderStyleClassAttribute(context, TIP_LABEL_STYLE_CLASS);
-    writer.writeAttribute("nowrap", Boolean.TRUE, null);
-
-    if (isRightToLeft(context))
-    {
-      writer.writeText(NBSP_STRING, null);
-      writer.writeText(getTranslatedValue(context, "af_panelTip.TIP"), null);
-    }
-    else
-    {
-      writer.writeText(getTranslatedValue(context, "af_panelTip.TIP"), null);
-      writer.writeText(NBSP_STRING, null);
-    }
-    writer.endElement("span");
-    // content
-    writer.startElement("span", null);
-    renderStyleClassAttribute(context, TIP_TEXT_STYLE_CLASS);
-  }
-
-  protected void postrender(
-    RenderingContext context,
-    UINode           node
-    ) throws IOException
-  {
-    ResponseWriter writer = context.getResponseWriter();
-    writer.endElement("span");
-    super.postrender(context, node);
-  }
-
-
-  protected String getElementName(
-    RenderingContext context,
-    UINode           node
-    )
-  {
-    return "div";
-  }
-
-}
+package org.apache.myfaces.adfinternal.ui.laf.base.pda;
+
+import javax.faces.context.ResponseWriter;
+
+import org.apache.myfaces.adfinternal.ui.laf.base.xhtml.XhtmlLafRenderer;
+
+import org.apache.myfaces.adfinternal.ui.RenderingContext;
+import org.apache.myfaces.adfinternal.ui.UINode;
+
+import java.io.IOException;
+
+/**
+ */
+public class TipRenderer extends XhtmlLafRenderer
+{
+  protected void renderAttributes(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    super.renderAttributes(context, node);
+  }
+
+  protected void prerender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    super.prerender(context, node);
+
+    ResponseWriter writer = context.getResponseWriter();
+    // tip icon
+    writer.startElement("span", null);
+    renderIcon(context, "tip.gif", "15", "13");
+    writer.endElement("span");
+
+    // tip label
+    writer.startElement("span", null);
+    renderStyleClassAttribute(context, TIP_LABEL_STYLE_CLASS);
+    writer.writeAttribute("nowrap", Boolean.TRUE, null);
+
+    if (isRightToLeft(context))
+    {
+      writer.writeText(NBSP_STRING, null);
+      writer.writeText(getTranslatedValue(context, "af_panelTip.TIP"), null);
+    }
+    else
+    {
+      writer.writeText(getTranslatedValue(context, "af_panelTip.TIP"), null);
+      writer.writeText(NBSP_STRING, null);
+    }
+    writer.endElement("span");
+    // content
+    writer.startElement("span", null);
+    renderStyleClassAttribute(context, TIP_TEXT_STYLE_CLASS);
+  }
+
+  protected void postrender(
+    RenderingContext context,
+    UINode           node
+    ) throws IOException
+  {
+    ResponseWriter writer = context.getResponseWriter();
+    writer.endElement("span");
+    super.postrender(context, node);
+  }
+
+
+  protected String getElementName(
+    RenderingContext context,
+    UINode           node
+    )
+  {
+    return "div";
+  }
+
+}

Propchange: incubator/adffaces/branches/matzew-repackaging-trinidad/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/adfinternal/ui/laf/base/pda/TipRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message