Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.RenderingContext


    @Override
    protected String getShortDesc(FacesBean bean)
    {
      String key = getDefaultShortDescKey();
      RenderingContext arc = RenderingContext.getCurrentInstance();
      return arc.getTranslatedString(key);
    }
View Full Code Here


    @Override
    protected void encodeAllChildren(
      FacesContext context, UIComponent component) throws IOException
    {
      ResponseWriter rw = context.getResponseWriter();
      RenderingContext rc = RenderingContext.getCurrentInstance();
      FacesBean bean = getFacesBean(component);

      ShuttleInfo shuttleInfo = _getShuttleInfo(rc);
      ContainerInfo containerInfo = _getContainerInfo(rc, _isLeading);

      rw.startElement("table", null);
      OutputUtils.renderLayoutTableAttributes(context, rc, null, null);

     

      // Render the filter, if needed
      if (_isLeading)
      {
        UIComponent filter = getFacet(component,
                                      CoreSelectManyShuttle.FILTER_FACET);
        if (filter != null)
        {
          _startRow(context,  3);
          encodeChild(context, filter);
          _endRow(context, rc, _DEFAULT_FILTER_HEIGHT);
        }
      }

      _startRow(context, 1);
      delegateRenderer(context,
                       rc,
                       component,
                       bean,
                       _list);

      if (!_isLeading && isReorderable())
      {
        rw.endElement("td");
        renderReorderButtons(context, rc, bean, containerInfo.id);
        rw.startElement("td", null);
      }

      boolean hasLeadingDesc = getLeadingDescShown(bean);
      boolean hasTrailingDesc = getTrailingDescShown(bean);
      boolean hasDescArea = hasLeadingDesc || hasTrailingDesc;
     
      _endRow(context, rc, 0);

      if (hasDescArea)
      {
        // Write out a spacer row beween the list and the description
        _startRow(context, 1);
        _endRow(context, rc, 8);

        _startRow(context, 3);
        rw.startElement("span", null);
        renderStyleClass(context, rc, SkinSelectors.INSTRUCTION_TEXT_STYLE_CLASS);
        String label = rc.getTranslatedString(_SELECT_MANY_DESCRIPTION_LABEL_KEY);
        rw.writeText(label, null);
        rw.endElement("span");
        rw.startElement("div", null);
        rw.endElement("div");
        rw.startElement("textarea", null);
View Full Code Here

    )
  {
    String onchange = super.getOnchange(bean);
    if (isAutoSubmit(bean))
    {
      RenderingContext arc = RenderingContext.getCurrentInstance();
      String source = LabelAndMessageRenderer.__getCachedClientId(arc);
      boolean immediate = isImmediate(bean);
      String auto = AutoSubmitUtils.getSubmitScript(arc, source, immediate);
      onchange = XhtmlUtils.getChainedJS(onchange, auto, true);
    }
View Full Code Here

        if (icon != null)
        {
          // The span is written out here because the writer needs to see the UIComponent.
          ResponseWriter writer = context.getResponseWriter();
          writer.startElement("span", node.getUIComponent());
          RenderingContext arc = RenderingContext.getCurrentInstance();
          FacesContext fContext = context.getFacesContext();
          icon.renderIcon(fContext, arc, _getNodeAttributeMap(context, node));
          writer.endElement("span");
        }
      }
View Full Code Here

  }

  @Override
  protected String getDefaultStyleClass(FacesBean bean)
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    if (((CoreRenderingContext) arc).isDefaultLinkStyleDisabled())
      return null;

    if (getDisabled(bean))
      return SkinSelectors.LINK_DISABLED_STYLE_CLASS;
View Full Code Here

  @Override
  public void addPartialTarget(UIComponent newTarget)
  {
    FacesContext fContext = __getFacesContext();

    RenderingContext afContext = RenderingContext.getCurrentInstance();

    PartialPageContext pContext = null;

    if (afContext != null)
      pContext = afContext.getPartialPageContext();

    // find the nearest ancestor that generates html markup:
    newTarget = _getNearestPPRTarget(newTarget);

    Object savedKey = null;
View Full Code Here

  @Override
  protected String getOnblur(FacesBean bean)
  {
    String onblur = super.getOnblur(bean);
    RenderingContext arc = RenderingContext.getCurrentInstance();
    String chooseId = _getChooseId(arc);

    int length = _BLUR_PREFIX.length() + 4;
    if (chooseId != null)
      length += chooseId.length();
View Full Code Here

  @Override
  protected String getOnfocus(FacesBean bean)
  {
    String onfocus = super.getOnfocus(bean);
    RenderingContext arc = RenderingContext.getCurrentInstance();
    String chooseId = _getChooseId(arc);

    // The special _dff handler is only needed for date fields
    // connected to a chooser;  the blur handler is needed all the time.
    if (chooseId != null)
View Full Code Here

  }

  @Override
  protected String getSearchDesc(FacesBean bean)
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();
    if (isInaccessibleMode(arc))
      return null;

    return arc.getTranslatedString(_LAUNCH_PICKER_TIP_KEY);
  }
View Full Code Here

  protected void renderEventHandlers(
    FacesContext context,
    FacesBean    bean) throws IOException
  {
    super.renderEventHandlers(context, bean);
    RenderingContext arc = RenderingContext.getCurrentInstance();
    ResponseWriter rw = context.getResponseWriter();

    if (PartialPageUtils.isPartialRenderingPass(arc))
    {
      rw.writeAttribute("onunload", _PARTIAL_ONUNLOAD_HANDLER, null);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.RenderingContext

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.