Package org.apache.myfaces.trinidad.component.core.output

Examples of org.apache.myfaces.trinidad.component.core.output.CoreOutputText


  }

  @SuppressWarnings("unchecked")
  public void setSeparator(ActionEvent event)
  {
    CoreOutputText output = new CoreOutputText();
    output.setValue("New Separator");
    _panel.getFacets().put("separator", output);
  }
View Full Code Here


    {
      CorePanelGroupLayout cpgl = new CorePanelGroupLayout();
      cpgl.setLayout("horizontal");
      HtmlOutputText hot = new HtmlOutputText();
      hot.setValue("foo");
      CoreOutputText cot = new CoreOutputText();
      cot.setValue("bar");

      cpgl.getChildren().add(hot);
      cpgl.getChildren().add(cot);

      Object state = context.saveComponent(cpgl);
View Full Code Here

    // 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

    super(testName);
  }

  public void testSimplePerf() throws IOException
  {
    CoreOutputText out = _createCoreOutputText();
    out.setValue("Plain value");
    UIViewRoot root = createTestTree(out, "testSimplePerf()");
    renderRoot(root);

    root = createTestTree(out, "testSimplePerf() 2");
    renderRoot(root);
View Full Code Here

    renderRoot(root);
  }

  public void testManyAttributes() throws IOException
  {
    CoreOutputText out = _createCoreOutputText();
    out.setValue("Plain value");
    out.setEscape(true);
    out.setId("OutId");
    out.setShortDesc("Short Desc");
    out.setStyleClass("Style Class");
    out.setOnclick("on click");

    /*
    out.setTruncateAt(100);
    out.setOnclick("on click");
    out.setOndblclick("on dblclick");
View Full Code Here

    return new HtmlOutputText();
  }

  private CoreOutputText _createCoreOutputText()
  {
    return new CoreOutputText();
    /*
    {
      public Renderer getRenderer(FacesContext context)
      {
        // Simulate the overhead of retrieving the renderer from the RenderKit
View Full Code Here

  @Override
  public void encodeBegin(FacesContext context,
                          UIComponent comp) throws IOException
  {
    RequestContext.getCurrentInstance();
    CoreOutputText cot = (CoreOutputText) comp;
    if (cot.isEscape())
    {
      ResponseWriter rw = context.getResponseWriter();
      rw.startElement("span", comp);
     
      rw.writeAttribute("id", cot.getId(), "id");
      rw.writeAttribute("title", cot.getShortDesc(), "title");
      rw.writeAttribute("class", cot.getStyleClass(), "styleClass");
      rw.writeAttribute("style", cot.getInlineStyle(), "inlineStyle");
      rw.writeAttribute("onclick", cot.getOnclick()null);
      rw.writeAttribute("ondblclick", cot.getOndblclick()null);
      rw.writeAttribute("onkeydown", cot.getOnkeydown()null);
      rw.writeAttribute("onkeyup", cot.getOnkeyup()null);
      rw.writeAttribute("onkeypress", cot.getOnkeypress()null);
      rw.writeAttribute("onmousedown", cot.getOnmousedown()null);
      rw.writeAttribute("onmousemove", cot.getOnmousemove()null);
      rw.writeAttribute("onmouseout", cot.getOnmouseout()null);
      rw.writeAttribute("onmouseover", cot.getOnmouseover()null);
      rw.writeAttribute("onmouseup", cot.getOnmouseup()null);
    }
  }
View Full Code Here

  @Override
  public void encodeEnd(FacesContext context,
                        UIComponent comp) throws IOException
  {
    RequestContext.getCurrentInstance()
    CoreOutputText cot = (CoreOutputText) comp;
    ResponseWriter rw = context.getResponseWriter();

    Object value = cot.getValue();
    if (!cot.isEscape())
    {
      if (value != null)
      {
        rw.write(value.toString());
      }
    }
    else
    {
      if (value != null)
      {
        String valueStr = value.toString();
        int truncateAt = cot.getTruncateAt();
        if (truncateAt > 0)
        {
          if (truncateAt < 13)
            truncateAt = 13;
          if (valueStr.length() > truncateAt)
            valueStr = valueStr.substring(0, truncateAt);
        }

        rw.writeText(valueStr, "value");
      }

      String description = cot.getDescription();
      if (description != null)
      {
        rw.startElement("span", null);
        rw.writeAttribute("class", "magicClass", null);
        rw.writeText(description, "description");
View Full Code Here

  // A proper implementation would create a separator appropriate
  // to the current locale
  private CoreOutputText _createSeparator(FacesContext context)
  {
    CoreOutputText output = new CoreOutputText();
    output.setValue("/");
    output.setTransient(true);
    return output;
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.core.output.CoreOutputText

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.