Examples of RenderingContext


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

  @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

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

    out.writeAttribute("id", compId, null);

    UIXRenderingContext rCtx = getRenderingContext(context, component);

    String styleClass = (String) component.getAttributes().get("styleClass");
    RenderingContext arc = RenderingContext.getCurrentInstance();
    if (styleClass != null)
    {
      XhtmlRenderer.renderStyleClasses(context, arc, new String [] {
        getContainerStyleClass(), styleClass});
    }
View Full Code Here

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

    out.startElement("table", component);
    out.writeAttribute("cellSpacing", "0", null);
    out.writeAttribute("cellPadding", "0", null);
    out.writeAttribute("summary", "", null);

    RenderingContext arc = RenderingContext.getCurrentInstance();
    XhtmlRenderer.renderStyleClass(context, arc, getContentStyleClass());

    out.startElement("tr", component);
    out.startElement("td", component);
View Full Code Here

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

    }

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

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

    }

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

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

    throws IOException
  {
    Map<String, String> requestParams =
      context.getExternalContext().getRequestParameterMap();
   
    RenderingContext arc = RenderingContext.getCurrentInstance();
    CoreDocument doc = new CoreDocument();
    context.getViewRoot().getChildren().add(doc);

    doc.setTitle(arc.getTranslatedString("af_inputColor.PICKER_TITLE"));
   
    CoreForm form = new CoreForm();
    form.setId("d");
    doc.getChildren().add(form);
   
    HtmlTableLayout tl = new HtmlTableLayout();
    form.getChildren().add(tl);
   
    HtmlRowLayout rl1 = new HtmlRowLayout();
    tl.getChildren().add(rl1);
    HtmlCellFormat cf1 = new HtmlCellFormat();
    rl1.getChildren().add(cf1);
    cf1.setHalign("center");
   
    CoreInputColor sic = new CoreInputColor();
    cf1.getChildren().add(sic);
    sic.setId("c");
    sic.setOnkeypress("if(_getKC(event)==13){selectColor();return false}");
    Converter converter = _getConverter(requestParams);
    Object value =
      converter.getAsObject(context, sic, requestParams.get("value"));
    sic.setConverter(converter);
    sic.setValue(value);
    sic.setChooseId("choose");
    sic.setLabel(arc.getTranslatedString("af_inputColor.PICKER_PROMPT"));

    HtmlRowLayout rl2 = new HtmlRowLayout();
    tl.getChildren().add(rl2);
    CoreSpacer spacer = new CoreSpacer();
    rl2.getChildren().add(spacer);
View Full Code Here

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


  @SuppressWarnings("unchecked")
  static void service(FacesContext context) throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();

    // Don't use HtmlHead or CoreDocument;  these add a stylesheet link,
    // which we don't need or want
    HtmlHtml root = new HtmlHtml();
    context.getViewRoot().getChildren().add(root);

    Map<String, String> requestParameters =
      context.getExternalContext().getRequestParameterMap();
   
    // Save the return ID - and do so before generating the
    // link to the frames!
    String returnId = requestParameters.get(_RETURN_ID_PARAM);
    if (returnId != null)
      CoreRenderKit.saveDialogPostbackValues(returnId);

    CoreOutputText headStart = new CoreOutputText();
    root.getChildren().add(headStart);
    headStart.setEscape(false);
    headStart.setValue("<head>");

    CoreImportScript cis = new CoreImportScript();
    cis.setNames(new String[]{"Core"});
    root.getChildren().add(cis);

    // The block-reload script only happens to work on IE, but may someday
    // work on Mozilla as well.
    HtmlScript script = new HtmlScript();
    script.setText(_BLOCK_RELOAD_TEXT + _FIX_DIALOG_TITLE);
    root.getChildren().add(script);

    CoreOutputText headEnd = new CoreOutputText();
    root.getChildren().add(headEnd);
    headStart.setEscape(false);
    headStart.setValue("</head>");

    HtmlFrame contentFrame = new HtmlFrame();
    String contentStr = arc.getTranslatedString(_FRAME_CONTENT);
    if (contentStr == null)
      contentStr = _DEFAULT_CONTENT_STRING;

    contentFrame.setShortDesc(contentStr); // for accessibility
    contentFrame.setLongDescURL("#");     // for accessibility
    contentFrame.setHeight("100%");
    contentFrame.setWidth("100%");

    // Get the query string.
    // trim out any "_t" parameter, which was only used to get here.
    // trim out any sizing parameters
    // trim out any redirect parameters
    String queryString = _getQueryString(
       context.getExternalContext().getRequestParameterValuesMap());

    // grab any sizing parameters
    String widthParam = requestParameters.get(_MIN_WIDTH_PARAM);
    boolean gotWidth = (widthParam != null);

    String heightParam = requestParameters.get(_MIN_HEIGHT_PARAM);
    boolean gotHeight = (heightParam != null);

    String viewIdRedirect = requestParameters.get(_VIEW_ID_REDIRECT_PARAM);
    if (viewIdRedirect != null)
    {
      ViewHandler vh =
        context.getApplication().getViewHandler();
      // Prepend an extra slash to avoid re-prepending the context path
      String redirectString = "/" + vh.getActionURL(context,
                                                    viewIdRedirect);
      // if redirectString contains ?, append queryString with &,
      // otherwise append queryString with &
      char sep = (redirectString.indexOf('?') != -1) ? '&' : '?';
      contentFrame.setSource(redirectString + sep + queryString);
    }
    else
    {
      String internalRedirect = requestParameters.get("_red");
      if (internalRedirect != null)
      {
        String path = GenericEntry.getGenericEntryURL(context,
                                                      internalRedirect);
        // Prepend an extra slash to avoid re-prepending the context path
        contentFrame.setSource("/" + path + "&" + queryString);
      }
    }

    HtmlFrameBorderLayout frameSet = new HtmlFrameBorderLayout();
    frameSet.setShortDesc(contentStr); // for accessibility
    frameSet.setCenter(contentFrame);
    // this border attribute is a "secret" attribute set to fix
    // 4339153 DIALOGS IN FIREFOX HAVE WHITE LINE AT THE BOTTOM
    frameSet.getAttributes().put("border", Boolean.FALSE);
    // see bug 3198336 apss accessibility violations
    CoreOutputText alternateContent = new CoreOutputText();
    alternateContent.setValue(arc.getTranslatedString("NO_FRAMES_MESSAGE"));
    frameSet.setAlternateContent(alternateContent);

    // Set the title to the title of the content, and then shrink (or expand)
    // the window to fit the content.  The 25 pixel fudge factor is purely
    // a hack to handle calendarDialog, which regularly needs to grow
View Full Code Here

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

    {
      writer.writeAttribute("type", type.toLowerCase(), "type");
      writer.writeAttribute("value", label, "value");
    }
   
    RenderingContext arc = RenderingContext.getCurrentInstance();
    String script = AutoSubmitUtils.getFullPageSubmitScript(
              arc, id, false,
              null/*no event*/,
              null,
              false/* return false*/);
 
View Full Code Here

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

  private void _writeScript(FacesContext context,
                            UIComponent component,
                            String js)
    throws IOException
  {
    RenderingContext arc = RenderingContext.getCurrentInstance();

    ResponseWriter writer = context.getResponseWriter();
   
    writer.startElement("script", null);
    XhtmlRenderer.renderScriptDeferAttribute(context, arc);
View Full Code Here

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

  /**
   * @return true if we are in inaccessible mode
   */
  public static boolean isInaccessibleMode(UIXRenderingContext context)
  {
    RenderingContext rc = RenderingContext.getCurrentInstance();
    return rc.getAccessibilityMode() ==
       RequestContext.Accessibility.INACCESSIBLE;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.