Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-197

More CSS for TabbedPane (incl. patch with solution)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.4-SNAPSHOT
    • Tabbed Pane
    • None
    • N/A

    Description

      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.
                  1. 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();

      Attachments

        1. patch.txt
          3 kB
          Wolfgang Engelhard

        Activity

          People

            mmarinschek Martin Marinschek
            enwo Wolfgang Engelhard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: