You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/08/09 12:22:18 UTC

git commit: WICKET-4704 Allow using custom CSS classes for the selected and last TabbedPanel tabs

Updated Branches:
  refs/heads/master 0c3013221 -> 5ab44248b


WICKET-4704 Allow using custom CSS classes for the selected and last TabbedPanel tabs


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/5ab44248
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/5ab44248
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/5ab44248

Branch: refs/heads/master
Commit: 5ab44248b68b75b4c08e1e88bc3886a585803f18
Parents: 0c30132
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Aug 9 13:18:21 2012 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Aug 9 13:18:21 2012 +0300

----------------------------------------------------------------------
 .../extensions/markup/html/tabs/TabbedPanel.java   |   25 ++++++++++++---
 1 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/5ab44248/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
index c8b2b47..92d302e 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tabs/TabbedPanel.java
@@ -221,11 +221,11 @@ public class TabbedPanel<T extends ITab> extends Panel
 
 				if (getIndex() == getSelectedTab())
 				{
-					cssClass += " selected";
+					cssClass += ' ' + getSelectedTabCssClass();
 				}
 				if (getIndex() == getTabs().size() - 1)
 				{
-					cssClass += " last";
+					cssClass += ' ' + getLastTabCssClass();
 				}
 				tag.put("class", cssClass.trim());
 			}
@@ -238,9 +238,6 @@ public class TabbedPanel<T extends ITab> extends Panel
 		};
 	}
 
-	/**
-	 * {@inheritDoc}
-	 */
 	@Override
 	protected void onBeforeRender()
 	{
@@ -283,6 +280,24 @@ public class TabbedPanel<T extends ITab> extends Panel
 	}
 
 	/**
+	 * @return the value of css class attribute that will be added to last tab. The
+	 *         default value is <code>last</code>
+	 */
+	protected String getLastTabCssClass()
+	{
+		return "last";
+	}
+
+	/**
+	 * @return the value of css class attribute that will be added to selected tab. The
+	 *         default value is <code>selected</code>
+	 */
+	protected String getSelectedTabCssClass()
+	{
+		return "selected";
+	}
+
+	/**
 	 * @return list of tabs that can be used by the user to add/remove/reorder tabs in the panel
 	 */
 	public final List<T> getTabs()