Author: dbiatenia
Date: 2007-07-31 09:59:59 -0400 (Tue, 31 Jul 2007)
New Revision: 1950
Modified:
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
trunk/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/css/tabPanel.xcss
trunk/ui/tabPanel/src/main/templates/tab.jspx
trunk/ui/tabPanel/src/main/templates/tabHeader.jspx
trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
Log:
RF-508, z-index bugfix
Modified:
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java
===================================================================
---
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-07-31
13:59:33 UTC (rev 1949)
+++
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabHeaderRendererBase.java 2007-07-31
13:59:59 UTC (rev 1950)
@@ -101,7 +101,7 @@
String width = tab.getLabelWidth();
- style += ";height : 100%; position : relative; z-index : 2;";
+ style += ";height : 100%; position : relative;";
if (width != null) {
style += " width: " + getUtils().encodePctOrPx(width) +
";";
}
Modified:
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
===================================================================
---
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-07-31
13:59:33 UTC (rev 1949)
+++
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-07-31
13:59:59 UTC (rev 1950)
@@ -51,8 +51,8 @@
public class TabPanelRendererBase extends
org.ajax4jsf.renderkit.HeaderResourcesRendererBase {
public final static String ACTIVE_CELL_CLASSES = "dr-tbpnl-tbcell-act
rich-tabhdr-cell-active";
- public final static String INACTIVE_CELL_CLASSES = "dr-tbpnl-tbcell-inact
rich-tabhdr-cell-inactive";
- public final static String DISABLED_CELL_CLASSES = "dr-tbpnl-tbcell-dsbld
rich-tabhdr-cell-disabled";
+ public final static String INACTIVE_CELL_CLASSES = "dr-tbpnl-tbcell-inact
dr-bottom-line rich-tabhdr-cell-inactive";
+ public final static String DISABLED_CELL_CLASSES = "dr-tbpnl-tbcell-dsbld
dr-bottom-line rich-tabhdr-cell-disabled";
protected Class getComponentClass() {
return UITabPanel.class;
@@ -184,6 +184,30 @@
return getUtils().getValueAsString(context, tabPanel);
}
+ public String getTabsCount(FacesContext context, UITabPanel tabPanel){
+ int count = 0;
+ String ret = "1";
+ for (Iterator iter = tabPanel.getTabs(); iter.hasNext();){
+ count++;
+ }
+ //center tabs group
+ ret = String.valueOf(count*2 - 1);
+ return ret;
+ }
+
+ public void writeColgroups(FacesContext context, UITabPanel tabPanel) throws
IOException{
+ StringBuffer buff = new StringBuffer();
+ if("left".equals(tabPanel.getHeaderAlignment())){
+ buff.append("<colgroup/>").append("<colgroup
span=\"" + getTabsCount(context, tabPanel) +
"\"/>").append("<colgroup width=\"100%\"/>");
+ } else if("center".equals(tabPanel.getHeaderAlignment())){
+ buff.append("<colgroup
width=\"33%\"/>").append("<colgroup width=\"34%\"
span=\"" + getTabsCount(context, tabPanel) +
"\"/>").append("<colgroup width=\"33%\"/>");
+ } else {
+ buff.append("<colgroup
width=\"100%\"/>").append("<colgroup span=\"" +
getTabsCount(context, tabPanel) +
"\"/>").append("<colgroup/>");
+ }
+ context.getResponseWriter().write(buff.toString());
+ //return null;
+ }
+
public void encodeTabs(FacesContext context, UITabPanel tabPanel) throws IOException
{
ComponentVariables componentVariables =
ComponentsVariableResolver.getVariables(this, tabPanel);
Modified:
trunk/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/css/tabPanel.xcss
===================================================================
---
trunk/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/css/tabPanel.xcss 2007-07-31
13:59:33 UTC (rev 1949)
+++
trunk/ui/tabPanel/src/main/resources/org/richfaces/renderkit/html/css/tabPanel.xcss 2007-07-31
13:59:59 UTC (rev 1950)
@@ -30,7 +30,7 @@
}
.dr-tb-inact td.dr-tb-bd {
- padding: 3px 5px 2px 5px;
+ padding: 3px 5px 0px 5px;
text-align: center;
cursor: pointer;
width: auto;
@@ -38,7 +38,7 @@
}
.dr-tb-inact-ovr td.dr-tb-bd {
- padding: 3px 5px 2px 5px;
+ padding: 3px 5px 0px 5px;
text-align: center;
cursor: pointer;
width: auto;
@@ -46,7 +46,7 @@
}
.dr-tb-dsbld td.dr-tb-bd {
- padding: 3px 5px 2px 5px;
+ padding: 3px 5px 0px 5px;
text-align: center;
cursor: default;
width: auto;
@@ -59,8 +59,12 @@
<f:verbatim>
.dr-tbpnl-cntnt {
- border-width: 1px;
- border-style: solid;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-right-width: 1px;
+ border-right-style: solid;
vertical-align: top;
}
@@ -70,7 +74,7 @@
}
.dr-tbpnl-tb{
- padding : 2px 10px 2px 10px;
+ padding : 2px 10px 0px 10px;
text-align: center;
}
@@ -83,25 +87,15 @@
border-width: 1px;
border-style: solid;
padding : 3px 10px 4px 10px;
- border-bottom : 0px;
background-repeat: repeat-x;
background-position: top;
+ border-bottom-width: 0px;
cursor : default;
}
-.dr-tbpnl-tb-inact {
- border-width: 1px;
- border-style: solid;
- border-bottom : 0px;
- background-repeat: repeat-x;
- background-position: top;
- cursor : default;
-}
-
.dr-tbpnl-tb-dsbld {
border-width: 1px;
border-style: solid;
- border-bottom : 0px;
background-repeat: repeat-x;
background-position: top;
cursor : default;
@@ -109,7 +103,8 @@
.dr-tbpnl-tbcell-dsbld, .dr-tbpnl-tbcell-inact {
padding-top: 2px;
- padding-bottom: 1px;
+
+
}
</f:verbatim>
@@ -123,9 +118,6 @@
<u:style name="color" skin="generalTextColor"/>
<u:style name="border-color" skin="subBorderColor"/>
</u:selector>
- <u:selector name=".dr-tbpnl-tb-inact">
- <u:style name="border-color" skin="subBorderColor"/>
- </u:selector>
<u:selector name=".dr-tbpnl-tb-dsbl">
<u:style name="border-color" skin="subBorderColor"/>
<u:style name="color" skin="tabDisabledTextColor"/>
@@ -158,7 +150,9 @@
<u:selector name=".dr-tbpnl-cntnt">
<u:style name="background-color"
skin="generalBackgroundColor"/>
<u:style name="color" skin="generalTextColor"/>
- <u:style name="border-color" skin="panelBorderColor"/>
+ <u:style name="border-bottom-color"
skin="panelBorderColor"/>
+ <u:style name="border-right-color" skin="panelBorderColor"/>
+ <u:style name="border-left-color" skin="panelBorderColor"/>
<u:style name="font-size" skin="generalSizeFont"/>
<u:style name="font-family" skin="generalFamilyFont"/>
</u:selector>
@@ -182,8 +176,25 @@
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.images.TabGradientB" />
</u:style>
+ <u:style name="border-color" skin="subBorderColor"/>
+
+ <u:style name="border-width" value="1px"/>
+ <u:style name="border-style" value="solid"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="top"/>
+ <u:style name="border-bottom-width" value="0px"/>
+ <u:style name="cursor" value="default"/>
+
</u:selector>
-
+
+
+ <u:selector name=".dr-bottom-line">
+ <u:style name="border-bottom-color"
skin="panelBorderColor"/>
+ <u:style name="border-bottom-style" value="solid"/>
+ <u:style name="border-bottom-width" value="1px"/>
+ </u:selector>
+
+
<u:selector name=".dr-tbpnl-tb-act">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.images.TabGradientA" />
Modified: trunk/ui/tabPanel/src/main/templates/tab.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tab.jspx 2007-07-31 13:59:33 UTC (rev 1949)
+++ trunk/ui/tabPanel/src/main/templates/tab.jspx 2007-07-31 13:59:59 UTC (rev 1950)
@@ -16,7 +16,7 @@
<td id="#{clientId}" style="position: relative;
#{this:getTabDisplay(context, component)}"
height="100%">
- <table border="0" cellpadding="10" cellspacing="0"
width="100%" class="dr-tbpnl-cntnt-pstn
rich-tabpanel-content-position" style="position : relative; z-index:
1;">
+ <table border="0" cellpadding="10" cellspacing="0"
width="100%" class="dr-tbpnl-cntnt-pstn
rich-tabpanel-content-position" style="position : relative;">
<tr>
<td class="dr-tbpnl-cntnt rich-tabpanel-content
#{component.pane.attributes['contentClass']}
#{component.attributes['styleClass']}"
style="#{component.attributes['contentStyle']};
#{component.attributes['style']}"
Modified: trunk/ui/tabPanel/src/main/templates/tabHeader.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tabHeader.jspx 2007-07-31 13:59:33 UTC (rev
1949)
+++ trunk/ui/tabPanel/src/main/templates/tabHeader.jspx 2007-07-31 13:59:59 UTC (rev
1950)
@@ -35,7 +35,7 @@
</table>
</td>
- <td><img src="#{spacer}" height="1" alt=""
border="0" style="#{this:encodeHeaderSpacing(context,
component)}"/></td>
+ <td class="dr-bottom-line"><img src="#{spacer}"
height="1" alt="" border="0"
style="#{this:encodeHeaderSpacing(context, component)}"/></td>
</f:root>
Modified: trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2007-07-31 13:59:33 UTC (rev 1949)
+++ trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2007-07-31 13:59:59 UTC (rev 1950)
@@ -36,13 +36,19 @@
<td align="#{component.headerAlignment}"><f:call
name="utils.encodeBeginFormIfNessesary" />
- <table border="0" cellpadding="0"
cellspacing="0">
+ <table border="0" cellpadding="0"
cellspacing="0">
+
<tr>
- <td>
+ <td class="dr-bottom-line">
<img src="#{spacer}" height="1" alt=""
border="0" style="#{this:encodeHeaderSpacing(context,
component)}" />
</td>
- <f:call name="encodeTabs" />
+ <f:call name="encodeTabs" />
+ <td class="dr-bottom-line" width="100%">
+ <img src="#{spacer}" height="1" alt=""
+ border="0" style="#{this:encodeHeaderSpacing(context,
component)}" />
+ </td>
+
</tr>
</table>
<div style="display: none;">