Author: ivaynberg
Date: Sun May 20 12:46:37 2007
New Revision: 539924

URL: http://svn.apache.org/viewvc?view=rev&rev=539924
Log:
WICKET-577 Improve TabbedPanel component - add ability to change tab-row 
container

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html
    
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html?view=diff&rev=539924&r1=539923&r2=539924
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.html
 Sun May 20 12:46:37 2007
@@ -15,7 +15,7 @@
    limitations under the License.
 -->
 <wicket:panel>
-<div class="tab-row">
+<div wicket:id="tabs-container" class="tab-row">
 <ul>
        <li wicket:id="tabs">
                <a href="#" wicket:id="link"><span wicket:id="title">[[tab 
title]]</span></a>

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java?view=diff&rev=539924&r1=539923&r2=539924
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
 Sun May 20 12:46:37 2007
@@ -22,6 +22,7 @@
 import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.behavior.AttributeAppender;
 import org.apache.wicket.behavior.SimpleAttributeModifier;
+import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.Link;
@@ -126,8 +127,20 @@
                        }
                };
 
+               WebMarkupContainer tabsContainer = new 
WebMarkupContainer("tabs-container")
+               {
+                       private static final long serialVersionUID = 1L;
+
+                       protected void onComponentTag(ComponentTag tag)
+                       {
+                               super.onComponentTag(tag);
+                               tag.put("class", getTabContainerCssClass());
+                       }
+               };
+               add(tabsContainer);
+
                // add the loop used to generate tab names
-               add(new Loop("tabs", tabCount)
+               tabsContainer.add(new Loop("tabs", tabCount)
                {
                        private static final long serialVersionUID = 1L;
 
@@ -164,6 +177,15 @@
                // select the first tab by default
                setSelectedTab(0);
 
+       }
+
+       /**
+        * @return the value of css class attribute that will be added to a div
+        *         containing the tabs. The default value is 
<code>tab-row</code>
+        */
+       protected String getTabContainerCssClass()
+       {
+               return "tab-row";
        }
 
        /**


Reply via email to