Package org.apache.myfaces.tobago.renderkit.css

Examples of org.apache.myfaces.tobago.renderkit.css.Style


    if (hasShadow) {
      // shadow begin
      writer.startElement(HtmlElements.DIV, box);
      writer.writeClassAttribute(Classes.create(box, "shadow"));

      Style shadow = new Style();
      shadow.setWidth(box.getCurrentWidth().subtract(1));
      shadow.setHeight(box.getCurrentHeight().subtract(1));
      writer.writeStyleAttribute(shadow);

      // border begin
      writer.startElement(HtmlElements.DIV, box);
      writer.writeClassAttribute(Classes.create(box, "border"));

      Style border = new Style();
      border.setWidth(box.getCurrentWidth().subtract(3));
      border.setHeight(box.getCurrentHeight().subtract(3));
      writer.writeStyleAttribute(border);
    }

    UIComponent label = box.getFacet(Facets.LABEL);
    writer.startElement(HtmlElements.DIV, null);
    writer.writeClassAttribute(Classes.create(box, "header"));
    String labelString = (String) box.getAttributes().get(Attributes.LABEL);
    if (label != null) {
      RenderUtils.encode(facesContext, label);
    } else if (labelString != null) {
      writer.writeText(labelString);
    }
    writer.endElement(HtmlElements.DIV);

    final UIMenuBar menuBar = getMenuBarFacet(box);
    if (menuBar != null) {
      RenderUtils.encode(facesContext, menuBar);
    }

    UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
    if (toolbar != null) {
      renderToolbar(facesContext, writer, box, toolbar);
    }
   
    if (hasShadow) {
      // border end
      writer.endElement(HtmlElements.DIV);
      // shadow end
      writer.endElement(HtmlElements.DIV);
    }

    writer.startElement(HtmlElements.DIV, null);
    writer.writeClassAttribute(Classes.create(box, "content")); // needed to be scrollable inside of the box
    final Style style = new Style(facesContext, box);
    final Measure borderLeft = box.getBorderLeft();
    final Measure borderRight = box.getBorderRight();
    final Measure borderTop = box.getBorderTop();
    final Measure borderBottom = box.getBorderBottom();
    style.setWidth(style.getWidth().subtract(borderLeft).subtract(borderRight));
    style.setHeight(style.getHeight().subtract(borderTop).subtract(borderBottom));
    style.setLeft(borderLeft);
    style.setTop(borderTop);
    writer.writeStyleAttribute(style);
  }
View Full Code Here


    String id = select.getClientId(facesContext);
    List<SelectItem> items = RenderUtils.getItemsToRender(select);
    String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
    boolean disabled = select.isDisabled();
    boolean readonly = select.isReadonly();
    Style style = new Style(facesContext, select);
    boolean required = select.isRequired();
    // fixme: use CSS, not the Style Attribute for "display"
    style.setDisplay(null);

    writer.startElement(HtmlElements.OL, select);
    writer.writeIdAttribute(id);
    writer.writeStyleAttribute(style);
    writer.writeClassAttribute(Classes.create(select));
View Full Code Here

    String id = select.getClientId(facesContext);
    List<SelectItem> items = RenderUtils.getItemsToRender(select);
    String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, select);
    boolean disabled = select.isDisabled();
    boolean readonly = select.isReadonly();
    Style style = new Style(facesContext, select);
    // fixme: use CSS, not the Style Attribute for "display"
    style.setDisplay(null);

    writer.startElement(HtmlElements.OL, select);
    writer.writeIdAttribute(id);
    writer.writeStyleAttribute(style);
    writer.writeClassAttribute(Classes.create(select));
View Full Code Here

    if (createSpan) {
      String id = out.getClientId(facesContext);
      writer.startElement(HtmlElements.SPAN, out);
      writer.writeIdAttribute(id);
      Style style = new Style(facesContext, out);
      writer.writeStyleAttribute(style);
      HtmlRendererUtils.renderDojoDndItem(out, writer, true);
      writer.writeClassAttribute(Classes.create(out));
      HtmlRendererUtils.renderTip(out, writer);
    }
View Full Code Here

//    page.encodeLayoutBegin(facesContext);
   
    writer.startElement(HtmlElements.DIV, page);
    writer.writeClassAttribute(Classes.create(page, "content"));
    writer.writeIdAttribute(clientId + ComponentUtils.SUB_SEPARATOR + "content");
    Style style = new Style(facesContext, page);
    // XXX position the div, so that the scrollable area is correct.
    // XXX better to take this fact into layout management.
    // XXX is also useful in boxes, etc.
    Measure border = getBorderBottom(facesContext, page);
    style.setHeight(page.getCurrentHeight().subtract(border));
    style.setTop(border);
    writer.writeStyleAttribute(style);
  }
View Full Code Here

    String id = time.getClientId(facesContext);
    final String idPrefix = id + ComponentUtils.SUB_SEPARATOR;
    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
    writer.startElement(HtmlElements.DIV, time);
    writer.writeClassAttribute(Classes.create(time));
    Style style = new Style(facesContext, time);
    writer.writeStyleAttribute(style);

    writer.startElement(HtmlElements.DIV, time);
    writer.writeAttribute(HtmlAttributes.ID, idPrefix + "borderDiv", false);
    Markup markup = time.getCurrentMarkup();
View Full Code Here

    List<UIMessages.Item> messageList = messages.createMessageList(facesContext);

    if (messageList.size() > 0) { // in ie empty span gets a height
      writer.startElement(HtmlElements.SPAN, messages);
      writer.writeClassAttribute(Classes.create(messages));
      writer.writeStyleAttribute(new Style(facesContext, messages));

      // with id
      /*String focusId = null;
      Iterator clientIds;
      if (ComponentUtils.getBooleanAttribute(messages, Attributes.GLOBAL_ONLY)) {
View Full Code Here

      popup.setTop(page.getCurrentHeight().subtract(popup.getCurrentHeight()).divide(2));
    }

    writer.startElement(HtmlElements.DIV, popup);
    writer.writeIdAttribute(clientId);
    Style style = new Style(facesContext, popup);
    Integer zIndex = popup.getZIndex();
    if (zIndex == null) {
      zIndex = 100;
      LOG.warn("No z-index found for UIPopup. Set to " + zIndex);
    }
    style.setZIndex(zIndex);
    writer.writeStyleAttribute(style);
    writer.writeClassAttribute(Classes.create(popup));
  }
View Full Code Here

   * @deprecated
   */
  @Deprecated
  public static Style ensureHtmlStyleMap(UIComponent component, Style styles) {
    if (styles == null) {
      styles = new Style();
      ((Map<String, Object>) component.getAttributes()).put(Attributes.STYLE, styles);
    }
    return styles;
  }
View Full Code Here

   * @deprecated Please use HtmlRendererUtils
   */
  @Deprecated
  private static Style ensureStyleAttributeMap(UIComponent component, String attribute) {
    final Map attributes = component.getAttributes();
    Style style = (Style) attributes.get(attribute);
    if (style == null) {
      style = new Style();
      attributes.put(attribute, style);
    }
    return style;
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.renderkit.css.Style

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.