protected void renderNonOverlappingItem()

in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/NavigationPaneRenderer.java [881:1069]


  protected void renderNonOverlappingItem(
    FacesContext        context,
    RenderingContext    rc,
    ResponseWriter      rw,
    Map<String, Object> itemData,
    boolean             isRtl,
    boolean             isBar,
    boolean             isList
    ) throws IOException
  {
    rw.startElement("table", null);
    OutputUtils.renderLayoutTableAttributes(context, rc, "0", null);
    String appendedStyle = null;
    if (!isList)
    {
      appendedStyle = "display: inline;"; // style to make the table inline

      // In Safari and webkit browsers display:inline doesn't work as expected, and
      // display:inline-block need to be used to make the table inline.
      // NokiaS60 has a webkit based browser
      if (rc.getAgent().getAgentName() == Agent.AGENT_WEBKIT || isNokiaS60(rc))
      {
        appendedStyle = "display: inline-block;";
      }
    }
    writeInlineStyles(rw, toString(itemData.get("inlineStyle")),
      appendedStyle); // user's style + what we must have on top of it
    rw.writeAttribute("title", itemData.get("shortDesc"), null);
    StringBuilder itemStyleClass = new StringBuilder();
    String userStyleClass = toString(itemData.get("styleClass"));
    if (userStyleClass != null)
    {
      itemStyleClass.append(userStyleClass);
      itemStyleClass.append(" "); // more style classes are appended below
    }

    // Assign the event handlers:
    boolean isDisabled = getBooleanFromProperty(itemData.get("isDisabled"));
    boolean isActive = getBooleanFromProperty(itemData.get("isActive"));
    if (isActive)
    {
      if (isDisabled)
      {
        if (isList)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_LIST_ACTIVE_DISABLED_STYLE_CLASS);
        }
        else if (isBar)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BAR_ACTIVE_DISABLED_STYLE_CLASS);
        }
        else
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_ACTIVE_DISABLED_STYLE_CLASS);
        }
      }
      else
      {
        if (isList)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_LIST_ACTIVE_ENABLED_STYLE_CLASS);
        }
        else if (isBar)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BAR_ACTIVE_ENABLED_STYLE_CLASS);
        }
        else
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_ACTIVE_ENABLED_STYLE_CLASS);
        }
      }
    }
    else
    {
      if (isDisabled)
      {
        if (isList)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_LIST_INACTIVE_DISABLED_STYLE_CLASS);
        }
        else if (isBar)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BAR_INACTIVE_DISABLED_STYLE_CLASS);
        }
        else
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_INACTIVE_DISABLED_STYLE_CLASS);
        }
      }
      else
      {
        if (isList)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_LIST_INACTIVE_ENABLED_STYLE_CLASS);
        }
        else if (isBar)
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BAR_INACTIVE_ENABLED_STYLE_CLASS);
        }
        else
        {
          itemStyleClass.append(
            SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_INACTIVE_ENABLED_STYLE_CLASS);
        }
      }
    }
    renderStyleClass(context, rc, itemStyleClass.toString());
    rw.startElement("tbody", null);
    if (!isList)
    {
      _writeInlineTbodyStyles(rc, rw);
    }
    rw.startElement("tr", null);

    if (isList)
    {
      rw.startElement("td", null); // bulletCell
      renderStyleClass(
        context,
        rc,
        SkinSelectors.AF_NAVIGATION_LEVEL_LIST_BULLET_STYLE_CLASS);
      rw.startElement("div", null); // bulletContent
      rw.write(" ");
      rw.endElement("div"); // bulletContent
      rw.endElement("td"); // bulletCell
    }

    rw.startElement("td", null); // centerCell
    rw.startElement("div", null); // centerContent
    if (isList)
    {
      renderStyleClass(context, rc,
        SkinSelectors.AF_NAVIGATION_LEVEL_LIST_CONTENT_STYLE_CLASS);
    }
    else if (isBar)
    {
      renderStyleClass(context, rc,
        SkinSelectors.AF_NAVIGATION_LEVEL_BAR_CONTENT_STYLE_CLASS);
    }
    else
    {
      renderStyleClass(context, rc,
        SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_CONTENT_STYLE_CLASS);
    }
    appendIconAndText(
      context,
      rc,
      rw,
      toString(itemData.get("icon")),
      itemData,
      isDisabled,
      isRtl);
    rw.endElement("div"); // centerContent
    rw.endElement("td"); // centerCell

    if ( !isList && !getBooleanFromProperty(itemData.get("isLast")) )
    {
      rw.startElement("td", null); // rightCell
      rw.startElement("div", null); // rightContent
      if (isBar)
      {
        renderStyleClass(context, rc,
          SkinSelectors.AF_NAVIGATION_LEVEL_BAR_SEPARATOR_STYLE_CLASS);
      }
      else
      {
        renderStyleClass(context, rc,
          SkinSelectors.AF_NAVIGATION_LEVEL_BUTTONS_SEPARATOR_STYLE_CLASS);
      }
      rw.write("|");
      rw.endElement("div"); // rightContent
      rw.endElement("td"); // rightCell
    }

    rw.endElement("tr");
    rw.endElement("tbody");
    rw.endElement("table");
  }