예제 #1
0
  private void _renderIconBlock(
      FacesContext context,
      RenderingContext arc,
      List<String> iconNames,
      String shortDesc,
      String styleClass,
      String iconStyleClass,
      List<String> stateStyleClasses)
      throws IOException {
    ResponseWriter writer = context.getResponseWriter();

    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);

    stateStyleClasses.add(styleClass);
    stateStyleClasses.add(iconStyleClass);

    renderStyleClasses(context, arc, stateStyleClasses.toArray(_EMPTY_STRING_ARRAY));

    if (iconNames != null) {
      // Render the first valid icon found. The list should be in
      // decreasing priority order.
      for (String iconName : iconNames) {
        Icon icon = arc.getIcon(iconName);
        if (icon != null) {
          OutputUtils.renderIcon(context, arc, icon, shortDesc, null);
          break;
        }
      }
    }

    writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
  }
예제 #2
0
  private void _preRenderIconBlock(FacesContext context, RenderingContext arc) throws IOException {
    ResponseWriter writer = context.getResponseWriter();

    // Icon cell
    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);

    // Icons need to be in a table to stretch well
    writer.startElement(XhtmlConstants.TABLE_ELEMENT, null);
    OutputUtils.renderLayoutTableAttributes(context, arc, "0", null);
    writer.writeAttribute(XhtmlConstants.STYLE_ATTRIBUTE, "width: 100%", null);

    writer.startElement(XhtmlConstants.TABLE_BODY_ELEMENT, null);
    writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
  }
예제 #3
0
 @Override
 protected void renderAllAttributes(FacesContext context, RenderingContext arc, FacesBean bean)
     throws IOException {
   super.renderAllAttributes(context, arc, bean);
   OutputUtils.renderLayoutTableAttributes(context, arc, "0", null);
 }