Package org.apache.myfaces.tobago.renderkit.html

Examples of org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap


    }

    HtmlRendererUtil.createHeaderAndBodyStyles(facesContext, data);

    final String sheetId = data.getClientId(facesContext);
    HtmlStyleMap sheetStyle = (HtmlStyleMap) data.getAttributes().get(TobagoConstants.ATTR_STYLE);

    TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);

    // Outher list div
    writer.startElement(HtmlConstants.DIV, null);
View Full Code Here


        = (TobagoResponseWriter) facesContext.getResponseWriter();
    String sheetId = data.getClientId(facesContext);
    SheetState sheetState = data.getSheetState(facesContext);
    List<UIColumn> renderedColumnList = data.getRenderedColumns();

    HtmlStyleMap sheetStyle = (HtmlStyleMap) data.getAttributes().get(TobagoConstants.ATTR_STYLE);
    Integer sheetHeight = HtmlRendererUtil.getStyleAttributeIntValue(sheetStyle, "height");
    if (sheetHeight == null) {
      // FIXME: nullpointer if height not defined
      LOG.error("no height in parent container, setting to 100");
      sheetHeight = 100;
    }
    int footerHeight = (Integer) data.getAttributes().get(TobagoConstants.ATTR_FOOTER_HEIGHT);

    HtmlStyleMap bodyStyle = (HtmlStyleMap) data.getAttributes().get(TobagoConstants.ATTR_STYLE_BODY);
    HtmlRendererUtil.replaceStyleAttribute(data, TobagoConstants.ATTR_STYLE_BODY, "height",
        (sheetHeight - footerHeight));


    List<Integer> columnWidths = data.getWidthList();
View Full Code Here

    writer.startElement(HtmlConstants.TR, null);
    writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);

    writer.startElement(HtmlConstants.TD, null);
    HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
    headerStyle.put("position", "relative");
    headerStyle.put("width", headerStyle.getInt("width"));
    int width = headerStyle.getInt("width");
    writer.writeStyleAttribute(headerStyle);
    writer.startElement(HtmlConstants.DIV, null);
    writer.writeStyleAttribute(headerStyle);

    writer.startElement(HtmlConstants.DIV, null);
    HtmlStyleMap map = new HtmlStyleMap();
    if (currentWidth > width) {
      map.put("width", currentWidth);
      map.put("left", width - toolbarWidth - currentWidth);
    } else {
      map.put("width", width - toolbarWidth);
    }
    map.put("overflow", "hidden");
    map.put("position", "absolute");
    writer.writeStyleAttribute(map);
    writer.startElement(HtmlConstants.TABLE, component);
    writer.writeAttribute(HtmlAttributes.BORDER, 0);
    writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
    writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
    writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
    headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
    writer.writeStyleAttribute(headerStyle);

    writer.startElement(HtmlConstants.COLGROUP, null);
    for (Integer colWidth : tabList.getWidthList()) {
      writer.startElement(HtmlConstants.COL, null);
      writer.writeAttribute(HtmlAttributes.WIDTH, colWidth);
      writer.endElement(HtmlConstants.COL);
    }
    writer.endElement(HtmlConstants.COLGROUP);

    writer.startElement(HtmlConstants.TR, null);
    writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);

    UIToolBar toolBar = null;
    if (toolbarWidth > 0) {
      toolBar = createToolBar(facesContext, component, virtualTab, switchType, tabList, clientId);
    }

    UITab activeTab = null;

    int index = 0;
    for (UIComponent child : (List<UIComponent>) component.getChildren()) {
      if (child instanceof UITab) {
        UITab tab = (UITab) child;
        if (tab.isRendered()) {
          String onclick;
          if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()
              && SWITCH_TYPE_RELOAD_TAB.equals(switchType)) {
            onclick = null;
          } else {
            onclick = "tobago_switchTab('"+ switchType + "','" + clientId + "'," + index + ','
                + component.getChildCount() + ')';
          }

          LabelWithAccessKey label = new LabelWithAccessKey(tab);
          StyleClasses outerClass = new StyleClasses();
          StyleClasses innerClass = new StyleClasses();
          if (virtualTab == index) {
            outerClass.addClass("tab", "selected-outer");
            innerClass.addClass("tab", "selected-inner");
            activeTab = (UITab) tab;
          } else {
            outerClass.addClass("tab", "unselected-outer");
            innerClass.addClass("tab", "unselected-inner");
          }
          outerClass.addMarkupClass(tab, "tab", "outer");
          innerClass.addMarkupClass(tab, "tab", "outer");
          writer.startElement(HtmlConstants.TD, tab);
          map = new HtmlStyleMap();
          map.put("width", tabList.getWidthList().get(index));

          writer.writeStyleAttribute(map);
          writer.writeIdAttribute(tab.getClientId(facesContext));

          HtmlRendererUtil.renderTip(tab, writer);
View Full Code Here

  }

  private void renderToolbar(FacesContext facesContext, TobagoResponseWriter writer, UIPanel toolbar, int width,
      int navigationBarWidth) throws IOException {
    writer.startElement(HtmlConstants.DIV, null);
    HtmlStyleMap map = new HtmlStyleMap();
    map.put("width", navigationBarWidth);
    map.put("left", width);
    writer.writeStyleAttribute(map);
    writer.writeClassAttribute("tobago-tabNavigationBar");
   
    RenderUtil.encode(facesContext, toolbar);
    writer.endElement(HtmlConstants.DIV);
View Full Code Here

  }

  protected void encodeContent(TobagoResponseWriter writer, FacesContext facesContext, UITab activeTab)
      throws IOException {

    HtmlStyleMap bodyStyle = (HtmlStyleMap)
        activeTab.getParent().getAttributes().get(ATTR_STYLE_BODY);
    writer.startElement(HtmlConstants.TR, null);
    writer.startElement(HtmlConstants.TD, null);
    StyleClasses classes = new StyleClasses();
    classes.addClass("tab", "content");
View Full Code Here

  }

  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
    HtmlStyleMap style = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE);

    if (style != null) {
      Integer styleHeight = style.getInt("height");
      if (styleHeight != null) {
        style.put("height", styleHeight-1);
      }
    }

    String clientId = component.getClientId(facesContext);
    writer.startElement(HtmlConstants.DIV, component);
View Full Code Here

    encodeBeginInner(facesContext, writer, component);
  }

  private void encodeBeginInner(FacesContext facesContext,
      TobagoResponseWriter writer, UIComponent component) throws IOException {
    HtmlStyleMap innerStyle = HtmlRendererUtil.prepareInnerStyle(component);

    renderBoxHeader(facesContext, writer, component);


    writer.startElement(HtmlConstants.DIV, component);
View Full Code Here

  private static final Log LOG = LogFactory.getLog(TabGroupRenderer.class);

  protected void encodeContent(TobagoResponseWriter writer,
      FacesContext facesContext, UITab activeTab) throws IOException {

    HtmlStyleMap bodyStyle = (HtmlStyleMap)
        activeTab.getParent().getAttributes().get(ATTR_STYLE_BODY);
    writer.startElement(HtmlConstants.TR, null);
    writer.startElement(HtmlConstants.TD, null);
    if (bodyStyle != null) {
      writer.writeStyleAttribute(bodyStyle);
View Full Code Here

    writer.startElement(HtmlConstants.TABLE, component);
    writer.writeAttribute(HtmlAttributes.BORDER, 0);
    writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
    writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
    writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
    HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(ATTR_STYLE_HEADER);
    writer.writeStyleAttribute(headerStyle);

    writer.startElement(HtmlConstants.TR, null);
    writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
View Full Code Here

  }

  protected void encodeContent(TobagoResponseWriter writer, FacesContext facesContext, UITab activeTab)
      throws IOException {

    HtmlStyleMap bodyStyle = (HtmlStyleMap)
        activeTab.getParent().getAttributes().get(ATTR_STYLE_BODY);
    writer.startElement(HtmlConstants.TR, null);
    writer.startElement(HtmlConstants.TD, null);
    StyleClasses classes = new StyleClasses();
    classes.addClass("tab", "content");
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.