You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/03/18 01:05:19 UTC

svn commit: r1082761 - in /myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel: AbstractHtmlCollapsiblePanel.java HtmlCollapsiblePanelRenderer.java

Author: lu4242
Date: Fri Mar 18 00:05:18 2011
New Revision: 1082761

URL: http://svn.apache.org/viewvc?rev=1082761&view=rev
Log:
TOMAHAWK-1554 CollapsiblePanel CSS Question (fix css styling)

Modified:
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/AbstractHtmlCollapsiblePanel.java
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelRenderer.java

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/AbstractHtmlCollapsiblePanel.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/AbstractHtmlCollapsiblePanel.java?rev=1082761&r1=1082760&r2=1082761&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/AbstractHtmlCollapsiblePanel.java (original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/AbstractHtmlCollapsiblePanel.java Fri Mar 18 00:05:18 2011
@@ -27,6 +27,7 @@ import javax.faces.component.behavior.Cl
 import javax.faces.context.FacesContext;
 import javax.faces.el.MethodBinding;
 
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
 import org.apache.myfaces.component.EventAware;
 import org.apache.myfaces.component.StyleAware;
 import org.apache.myfaces.component.UniversalProperties;
@@ -288,4 +289,43 @@ public abstract class AbstractHtmlCollap
         return super.isRequired();
     }
     
+    /**
+     * The CSS class for this element.  Corresponds to the HTML 'class' attribute for the generated indicator span.
+     * This attribute is ignored if a custom "header" facet is provided
+     * for the collapsible panel 
+     * 
+     * @return
+     */
+    @JSFProperty
+    public abstract String getIndicatorStyleClass();
+    
+    /**
+     * HTML: CSS styling instructions for the generated indicator. 
+     * This attribute is ignored if a custom "header" facet is provided
+     * for the collapsible panel 
+     * 
+     * @return
+     */
+    @JSFProperty
+    public abstract String getIndicatorStyle(); 
+    
+    /**
+     * The CSS class for this element.  Corresponds to the HTML 'class' attribute for the generated title.
+     * This attribute is ignored if a custom "header" facet is provided
+     * for the collapsible panel 
+     * 
+     * @return
+     */
+    @JSFProperty
+    public abstract String getTitleStyleClass();
+    
+    /**
+     * HTML: CSS styling instructions for the generated title. 
+     * This attribute is ignored if a custom "header" facet is provided
+     * for the collapsible panel 
+     * 
+     * @return
+     */
+    @JSFProperty
+    public abstract String getTitleStyle(); 
 }

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelRenderer.java?rev=1082761&r1=1082760&r2=1082761&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelRenderer.java (original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/custom/collapsiblepanel/HtmlCollapsiblePanelRenderer.java Fri Mar 18 00:05:18 2011
@@ -218,14 +218,14 @@ public class HtmlCollapsiblePanelRendere
         link.setTransient(true);
         link.setImmediate(true);
 
-        List children = link.getChildren();
+        List<UIComponent> children = link.getChildren();
         // Create the indicator. You could later make this conditional and render optional images instead
         HtmlOutputText uiText = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
         uiText.setTransient(true);
         uiText.setValue(collapsiblePanel.isCollapsed() ? "&gt;" : "&#957;");
         uiText.setEscape(false);
-        uiText.setStyleClass(collapsiblePanel.getStyleClass());
-        uiText.setStyle(collapsiblePanel.getStyle());
+        uiText.setStyleClass(collapsiblePanel.getIndicatorStyleClass());
+        uiText.setStyle(collapsiblePanel.getIndicatorStyle());
         children.add(uiText);
 
         // Create the optional label
@@ -234,8 +234,8 @@ public class HtmlCollapsiblePanelRendere
             uiText = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
             uiText.setTransient(true);
             uiText.setValue(" " + label);
-            uiText.setStyleClass(collapsiblePanel.getStyleClass());
-            uiText.setStyle(collapsiblePanel.getStyle());
+            uiText.setStyleClass(collapsiblePanel.getTitleStyleClass());
+            uiText.setStyle(collapsiblePanel.getTitleStyle());
             children.add(uiText);
         }
         return link;