當前位置: 首頁>>代碼示例>>Java>>正文


Java ResponseWriter.endElement方法代碼示例

本文整理匯總了Java中javax.faces.context.ResponseWriter.endElement方法的典型用法代碼示例。如果您正苦於以下問題:Java ResponseWriter.endElement方法的具體用法?Java ResponseWriter.endElement怎麽用?Java ResponseWriter.endElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.faces.context.ResponseWriter的用法示例。


在下文中一共展示了ResponseWriter.endElement方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: _renderDisableJsfAjaxScript

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
private void _renderDisableJsfAjaxScript(
  FacesContext     context,
  RenderingContext rc
  ) throws IOException 
{
  if (!supportsScripting(rc))
  {
    return;
  }
  ExternalContext extContext = context.getExternalContext();
  if ("off".equalsIgnoreCase(extContext.getInitParameter(_PPR_OVER_JSF_AJAX)))
  {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement("script", null);
    writer.write("TrPage.getInstance().__disablePprOverJsfAjax()");
    writer.endElement("script");
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:19,代碼來源:BodyRenderer.java

示例2: _writeSelectItems

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
private void _writeSelectItems(
  FacesContext     context,
  List<SelectItem> items,
  int              selectedIndex
  ) throws IOException
{
  ResponseWriter writer = context.getResponseWriter();
  int count = items.size();
  for (int i = 0; i < count; i++)
  {
    SelectItem item = items.get(i);
    writer.startElement("option", null);
    writer.writeAttribute("value", item.getValue(), null);
    if (i == selectedIndex)
      writer.writeAttribute("selected", Boolean.TRUE, null);
    writer.writeText(item.getLabel(), null);
    writer.endElement("option");
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:20,代碼來源:SelectRangeChoiceBarRenderer.java

示例3: encodeMarkup

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
protected void encodeMarkup(FacesContext context, AbstractMenu abstractMenu)
/*     */     throws IOException
/*     */   {
/*  41 */     SentinelMenu menu = (SentinelMenu)abstractMenu;
/*  42 */     ResponseWriter writer = context.getResponseWriter();
/*  43 */     String clientId = menu.getClientId(context);
/*  44 */     String style = menu.getStyle();
/*  45 */     String styleClass = menu.getStyleClass();
/*  46 */     styleClass = "layout-menubar-container " + styleClass;
/*     */ 
/*  48 */     writer.startElement("ul", menu);
/*  49 */     if (shouldRenderId(null)) {
/*  50 */       writer.writeAttribute("id", clientId, "id");
/*     */     }
/*  52 */     writer.writeAttribute("class", styleClass, "styleClass");
/*  53 */     if (style != null) {
/*  54 */       writer.writeAttribute("style", style, "style");
/*     */     }
/*     */ 
/*  57 */     if (menu.getElementsCount() > 0) {
/*  58 */       encodeElements(context, menu, menu.getElements(), 0);
/*     */     }
/*     */ 
/*  61 */     writer.endElement("ul");
/*     */   }
 
開發者ID:marlonalexis,項目名稱:Multicentro_Mascotas,代碼行數:26,代碼來源:SentinelMenuRenderer.java

示例4: _renderNavigation1

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * render two tds, one with the navigation1 and one with a spacer
 * @return void
 */
private void  _renderNavigation1(
  FacesContext     context,
  RenderingContext rc,
  ResponseWriter   writer,
  UIComponent      navigation1,
  boolean          isRTL
  ) throws IOException
{
  writer.startElement("td", null);
  writer.writeAttribute("align", (isRTL)
                                   ? "left"
                                   : "right", null);
  writer.writeAttribute("valign", "bottom", null);
  encodeChild(context, navigation1);
  writer.endElement("td");

  writer.startElement("td", null);
  renderSpacer(context, rc, _NAVIGATION1_SPACER_SIZE, "1");
  writer.endElement("td");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:25,代碼來源:DesktopPanelPageHeaderRenderer.java

示例5: renderAfterTextField

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * render the spinboxes after the text field. Render these even if
 * they are disabled.
 * @param context
 * @param rc
 * @param component
 * @param bean
 * @throws IOException
 */
@Override
protected void renderAfterTextField(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();
  rw.startElement("td", component);
  rw.writeAttribute("align", "center", null);
  rw.writeAttribute("valign", "middle", null);

  renderStyleClass(context, rc, "af|inputNumberSpinbox::spinbox-cell");
  // use css to put in a space.???
  renderIcon(context, rc, component, bean);
  rw.endElement("td");
  rw.endElement("tr");
  rw.endElement("table");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:30,代碼來源:SimpleInputNumberSpinboxRenderer.java

示例6: encodeAll

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
@Override
protected void encodeAll(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();
  rw.startElement("table", component);
  renderId(context, component);
  renderAllAttributes(context, rc, component, bean);
  renderHAlign(context, rc, getHalign(component, bean));
  // TODO: if TABLES_CAP_ADVANCED and TABLES_CAP_ADVANCED_ATTRS
  // are both false, don't render cell padding, cell spacing, or border

  // Normally, you would think tableLayout would be a layout table. But this component also allows
  // the assignment of a summary, which is usually only present on a data table (and is set to ""
  // for a layout table). So, based on whether there is a summary attribute or not, we'll render as
  // either a data or layout table.
  Object summary = getSummary(component, bean);
  if (summary.equals(""))
  {
    OutputUtils.renderLayoutTableAttributes(context, rc, getCellPadding(component, bean),
      getCellSpacing(component, bean), getBorderWidth(component, bean),
      getWidth(component, bean));
  }
  else
  {
    OutputUtils.renderDataTableAttributes(context, rc, getCellPadding(component, bean),
      getCellSpacing(component, bean), getBorderWidth(component, bean),
      getWidth(component, bean), getSummary(component, bean));
  }

  encodeAllChildren(context, component);

  rw.endElement("table");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:39,代碼來源:TableLayoutRenderer.java

示例7: renderControlBarLink

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
protected void renderControlBarLink(
  FacesContext     context,
  RenderingContext rc,
  String           onclick,
  String           translationKey,
  Icon             icon,
  String           id,
  boolean          hasDivider
  ) throws IOException
{
  ResponseWriter writer = context.getResponseWriter();
  writer.startElement("a", null);
  writer.writeAttribute(XhtmlConstants.ID_ATTRIBUTE, id, null);
  renderStyleClass(context, rc, SkinSelectors.NAV_BAR_ALINK_STYLE_CLASS);
  writer.writeAttribute("onclick", onclick, null);
  writer.writeURIAttribute("href", "#", null);
  if (icon != null)
  {
    OutputUtils.renderIcon(context, rc, icon, rc.getTranslatedString(translationKey),
                           null);
  } else
  {
    writer.writeText(rc.getTranslatedString(translationKey), null);
  }

  writer.endElement("a");

  if (hasDivider)
    writer.writeText(LINKS_DIVIDER_TEXT, null);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:31,代碼來源:TreeTableRenderer.java

示例8: encodeChild

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * Render a single child (or the separator facet)
 */
protected void encodeChild(
  FacesContext context,
  UIComponent  child,
  Object       vAlign
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();
  rw.startElement("td", null);
  rw.writeAttribute("valign", vAlign, null);

  encodeChild(context, child);

  rw.endElement("td");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:18,代碼來源:PanelHorizontalLayoutRenderer.java

示例9: renderBetweenIndexedChildren

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * Override of renderBetweenIndexedChildren() which renders a separator
 * style on the td. The style will be af|panelTabbed::separator-before-selected,
 * af|panelTabbed::separator-after-selected, or af|panelTabbed::separator.
 */
@Override
protected void renderBetweenIndexedChildren(
  UIXRenderingContext context,
  UINode           node
  ) throws IOException
{
  Boolean beforeSelected = (Boolean)context.getLocalProperty(
                              0, _BEFORE_SELECTED_KEY, Boolean.FALSE);
  Boolean afterSelected = (Boolean)context.getLocalProperty(
                              0, _AFTER_SELECTED_KEY, Boolean.FALSE);
  
  String styleClass = (Boolean.TRUE.equals(afterSelected)) ? 
                       _SEPARATOR_AFTER_SELECTED_STYLE:
                       (Boolean.TRUE.equals(beforeSelected)) ?
                       _SEPARATOR_BEFORE_SELECTED_STYLE :
                       _SEPARATOR_STYLE;


  ResponseWriter writer = context.getResponseWriter();
  writer.startElement(TABLE_DATA_ELEMENT, null);

  renderStyleClassAttribute(context, styleClass);
  //IE seems to need something in the cell in order for styles to take effect. 
  renderHorizontalSpacer(context, "0");
  writer.endElement(TABLE_DATA_ELEMENT);

}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:33,代碼來源:SubTabBarRenderer.java

示例10: _renderChoiceLabel

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
private void _renderChoiceLabel(
  FacesContext     context,
  RenderingContext rc,
  ResponseWriter   rw,
  boolean          isRtl,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  String chooseText = getTitle(component, bean);
  if ( (chooseText == null) || (chooseText.length() == 0) )
  {
    chooseText = getShortDesc(component, bean);
  }

  if ( (chooseText != null) && (chooseText.length() != 0) )
  {
    if (isRtl)
    {
      _renderSpace(rw);
    }
    rw.startElement("span", null);
    renderStyleClass(context, rc,
      SkinSelectors.AF_NAVIGATION_LEVEL_CHOICE_LABEL_STYLE_CLASS);
    rw.write(chooseText);
    rw.endElement("span");
    if (!isRtl)
    {
      _renderSpace(rw);
    }
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:33,代碼來源:NavigationPaneRenderer.java

示例11: renderSelectionLinks

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * @todo Support autoSubmit!
 */
protected void renderSelectionLinks(FacesContext context, RenderingContext rc, TableRenderingContext tContext,
                                    UIComponent component)
  throws IOException
{
  // Never render for empty tables
  if (tContext.getRowData().isEmptyTable())
    return;

  // =-=AEW For some odd reason, we want all the above rendering even if we don't
  // have select all or detail disclosure, just not this cell.
  if (hasControlBarLinks(context, rc, tContext, component))
  {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
    writer.startElement(XhtmlConstants.TABLE_ELEMENT, null);
    OutputUtils.renderLayoutTableAttributes(context, rc, "0", "100%");
    renderStyleClass(context, rc, SkinSelectors.AF_TABLE_SUB_CONTROL_BAR_STYLE);
    writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
    writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, null);
    writer.writeAttribute("nowrap", Boolean.TRUE, null);
    writer.writeAttribute("valign", XhtmlConstants.MIDDLE_ATTRIBUTE_VALUE, null);

    renderControlBarLinks(context, rc, tContext, component, false);

    writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
    writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
    writer.endElement(XhtmlConstants.TABLE_ELEMENT);
    writer.endElement(XhtmlConstants.TABLE_DATA_ELEMENT);
    writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:36,代碼來源:DesktopTableRenderer.java

示例12: encodeAllAsNonElement

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
@Override
protected void encodeAllAsNonElement(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  if (isTextArea(component, bean))
  {
    /* renderAsElement == false, isTextArea == true */
    renderContent(context, rc, component, bean, false, true);
  }
  else
  {
    ResponseWriter rw = context.getResponseWriter();
    boolean isSimple = isSimpleInputText(component, bean);
    if (isSimple)
    {
      rw.startElement("span", component);
      renderRootDomElementStyles(context, rc, component, bean);
      renderId(context, component);
    }

    // =-=jmw put the 'content' piece here for read-only. It's a div in rich.
    rw.startElement("div", component);
    if (!isSimple)
      renderId(context, component);

    renderStyleClass(context, rc, getContentStyleClass(component, bean));
    renderInlineStyleAttribute(context, rc, component, getContentStyle(component, bean));
    rw.writeAttribute("title", getShortDesc(component, bean), "shortDesc");
    /* renderAsElement == false, isTextArea == false */
    renderContent(context, rc, component, bean, false, false);
    rw.endElement("div");
    if (isSimpleInputText(component, bean))
      rw.endElement("span");
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:40,代碼來源:SimpleInputTextRenderer.java

示例13: _renderParamAttribute

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
/**
 * Renders a name value pair as a <param> element
 */
private void _renderParamAttribute(
  FacesContext context,
  String       paramName,
  Object       paramValue,
  boolean      isURL
  ) throws IOException
{
  if ( paramValue != null )
  {
    ResponseWriter writer = context.getResponseWriter();

    writer.startElement("param", null);
    writer.writeAttribute("name", paramName, null);

    if (isURL)
    {
      renderEncodedResourceURI(context, "value", paramValue);
    }
    else
    {
      writer.writeAttribute("value", paramValue, null);
    }

    writer.endElement("param");
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:30,代碼來源:MediaRenderer.java

示例14: _renderContent

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
private void _renderContent(
    UIXRenderingContext context,
    UINode           node,
    UIXHierarchy     tree,
    String name
    ) throws IOException
  {
    
    UINode stamp = getStamp(context, node);
    if(stamp == null)
      stamp = _DEFAULT_STAMP;  

//@todo - will this tree.getFocusPath survive?
//    List focusPath = getFocusPath(context, node);
    Object focusPath = tree.getFocusRowKey();
    String formName = getParentFormName(context);
    if (formName == null)
    {
      _LOG.warning("TREE_COMPONENT_MUST_INSIDE_FORM");
      return;
    }


    // Bug 3931544:  don't use colons in Javascript variable names.
    // We'll just replace colons with underscores;  not perfect, but adequate
    final String varName = "_adftree" +
            XhtmlUtils.getJSIdentifier(name);

    boolean leftToRight = !context.getLocaleContext().isRightToLeft();
    int rootSize = tree.getRowCount();
    RowKeySet state = getExpandedRowKeys(tree);      
    Map<Object, Boolean> selectedPaths = getSelectedPaths(focusPath);
    UINode icon = getIcon();

    // render each of the root nodes
    for (int i = 0; i < rootSize; i++)
    {
      tree.setRowIndex(i);
      _renderNode(context,
                  tree,
                  icon,
                  stamp,
                  varName,
                  state,
                  selectedPaths,
                  new Boolean[_DEFAULT_TREE_DEPTH],
                  leftToRight,
                  (i == 0),
                  (i == rootSize - 1),
                  0);
    }

    ResponseWriter writer = context.getResponseWriter();
    writer.startElement(SCRIPT_ELEMENT, null);
    renderScriptDeferAttribute(context);

    // Bug #3426092:
    // render the type="text/javascript" attribute in accessibility mode
    XhtmlLafRenderer.renderScriptTypeAttribute(context);

    _renderTreeJS(context, node);

    //out.writeText("_setNodes('"+name+"','"+nodesRendered+"');");

    String selectedParam =
      name + NamingContainer.SEPARATOR_CHAR +
      org.apache.myfaces.trinidadinternal.renderkit.uix.TreeRenderer.SELECTED_PARAM;

    writer.writeText("var "+varName+" = "+
                     _createNewJSSelectionState(formName, name, selectedParam), null);
    writer.endElement(SCRIPT_ELEMENT);

    FormValueRenderer.addNeededValue(context, formName, selectedParam);
    FormValueRenderer.addNeededValue(context, formName, PARTIAL_TARGETS_PARAM);
    FormValueRenderer.addNeededValue(context, formName, PARTIAL_PARAM);
    FormValueRenderer.addNeededValue(context, formName, _PATH_PARAM);
    
    
  }
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:80,代碼來源:TreeRenderer.java

示例15: encodeAll

import javax.faces.context.ResponseWriter; //導入方法依賴的package包/類
@Override
protected void encodeAll(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  ResponseWriter rw = context.getResponseWriter();
  rw.startElement("div", component);
  renderId(context, component);
  renderAllAttributes(context, rc, component, bean);

   // tip label
  rw.startElement("span", null);
  renderStyleClass(context, rc, SkinSelectors.AF_PANEL_TIP_LABEL_STYLE_CLASS);

  String tipText = rc.getTranslatedString("af_panelTip.TIP");
  if (rc.isRightToLeft())
  {
    rw.writeText(XhtmlConstants.NBSP_STRING, null);
    rw.writeText(tipText, null);
  }
  else
  {
    rw.writeText(tipText, null);
    rw.writeText(XhtmlConstants.NBSP_STRING, null);
  }

  rw.endElement("span");

  // content
  rw.startElement("span", null);
  renderStyleClass(context, rc,  SkinSelectors.AF_PANEL_TIP_CONTENT_STYLE_CLASS);

  encodeAllChildren(context, component);

  rw.endElement("span");

  rw.endElement("div");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:42,代碼來源:PanelTipRenderer.java


注:本文中的javax.faces.context.ResponseWriter.endElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。