[ http://issues.apache.org/jira/browse/TOMAHAWK-197?page=all ]
Martin Marinschek updated TOMAHAWK-197:
---
Status: Resolved (was: Patch Available)
Fix Version/s: 1.1.4-SNAPSHOT
Resolution: Fixed
Assignee: Martin Marinschek
Thanks to Wolfgang Engelhard for this patch.
More CSS for TabbedPane (incl. patch with solution)
---
Key: TOMAHAWK-197
URL: http://issues.apache.org/jira/browse/TOMAHAWK-197
Project: MyFaces Tomahawk
Issue Type: New Feature
Components: Tabbed Pane
Environment: N/A
Reporter: Wolfgang Engelhard
Assigned To: Martin Marinschek
Priority: Minor
Fix For: 1.1.4-SNAPSHOT
Attachments: patch.txt
For better control of style on your tabbed pane you need attribute id or
style for the tag tr.
The following patch (created with eclipse and NOT TESTED ) should address
this (you need to adjust the paths to your workspace requirements, sorry for
the inconvenience).
Please test first, even if changes are minor, as I wasn't able to compile
this (dependencies and build environment) !
This may also solve some of Jim Wrights issues, tomahawk-22 and tomahawk-54.
Expected problems are:
- writeAttribute not working as expected and
- no documentation of additionally available styles.
### patch begin, copy and paste from next line till end ##
Index:
D:/projects/tomahawk/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java
===
---
D:/projects/tomahawk/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java
(revision 385479)
+++
D:/projects/tomahawk/src/main/java/org/apache/myfaces/custom/tabbedpane/HtmlTabbedPaneRenderer.java
(working copy)
@@ -44,15 +44,18 @@
public class HtmlTabbedPaneRenderer
extends HtmlRenderer
{
+private static final String HEADER_ROW_CLASS =
myFaces_pannelTabbedPane_HeaderRow;
private static final String ACTIVE_HEADER_CELL_CLASS =
myFaces_panelTabbedPane_activeHeaderCell;
private static final String INACTIVE_HEADER_CELL_CLASS =
myFaces_panelTabbedPane_inactiveHeaderCell;
private static final String DISABLED_HEADER_CELL_CLASS =
myFaces_panelTabbedPane_disabledHeaderCell;
private static final String EMPTY_HEADER_CELL_CLASS =
myFaces_panelTabbedPane_emptyHeaderCell;
+private static final String SUB_HEADER_ROW_CLASS =
myFaces_pannelTabbedPane_subHeaderRow;
private static final String SUB_HEADER_CELL_CLASS =
myFaces_panelTabbedPane_subHeaderCell;
private static final String SUB_HEADER_CELL_CLASS_ACTIVE =
myFaces_panelTabbedPane_subHeaderCell_active;
private static final String SUB_HEADER_CELL_CLASS_INACTIVE =
myFaces_panelTabbedPane_subHeaderCell_inactive;
private static final String SUB_HEADER_CELL_CLASS_FIRST =
myFaces_panelTabbedPane_subHeaderCell_first;
private static final String SUB_HEADER_CELL_CLASS_LAST =
myFaces_panelTabbedPane_subHeaderCell_last;
+private static final String CONTENT_ROW_CLASS =
myFaces_panelTabbedPane_contentRow;
private static final String TAB_PANE_CLASS =
myFaces_panelTabbedPane_pane;
private static final String DEFAULT_BG_COLOR = white;
@@ -164,6 +167,7 @@
writeTableStart(writer, facesContext, tabbedPane);
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.TR_ELEM, tabbedPane);
+writer.writeAttribute(HTML.CLASS_ATTR, HEADER_ROW_CLASS, null);
//Tab headers
int tabIdx = 0;
@@ -207,6 +211,7 @@
//Sub header cells
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.TR_ELEM, tabbedPane);
+writer.writeAttribute(HTML.CLASS_ATTR, SUB_HEADER_ROW_CLASS, null);
writeSubHeaderCells(writer, facesContext, tabbedPane,
visibleTabCount, visibleTabSelectedIdx);
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.endElement(HTML.TR_ELEM);
@@ -214,6 +219,7 @@
//Tabs
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.TR_ELEM, tabbedPane);
+writer.writeAttribute(HTML.CLASS_ATTR, CONTENT_ROW_CLASS, null);
writer.startElement(HTML.TD_ELEM, tabbedPane);
writer.writeAttribute(HTML.COLSPAN_ATTR,
Integer.toString(visibleTabCount + 1), null);
String tabContentStyleClass = tabbedPane.getTabContentStyleClass();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: