Examples of IMarkupFragment


Examples of org.apache.wicket.markup.IMarkupFragment

   * Performs a render of this component as part of a Page level render process.
   */
  private final void internalRender()
  {
    // Make sure there is a markup available for the Component
    IMarkupFragment markup = getMarkup();
    if (markup == null)
    {
      throw new MarkupNotFoundException("Markup not found for Component: " + toString());
    }

    // MarkupStream is an Iterator for the markup
    MarkupStream markupStream = new MarkupStream(markup);

    // Flag: we started the render process
    markRendering(true);

    MarkupElement elem = markup.get(0);
    if (elem instanceof ComponentTag)
    {
      // Guarantee that the markupStream is set and determineVisibility not yet tested
      // See WICKET-2049
      ((ComponentTag)elem).onBeforeRender(this, markupStream);
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

   * onComponentTag() is called to allow the component to mutate the start tag. The method
   * onComponentTagBody() is then called to permit the component to render its body.
   */
  public final void internalRenderComponent()
  {
    final IMarkupFragment markup = getMarkup();
    if (markup == null)
    {
      throw new MarkupException("Markup not found. Component: " + toString());
    }

View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

    }

    @Override
    public IMarkupFragment getMarkup()
    {
      IMarkupFragment calculatedMarkup = null;
      if (pageMarkup == null)
      {
        IMarkupFragment markup = super.getMarkup();
        if (markup != null && markup != Markup.NO_MARKUP)
        {
          calculatedMarkup = markup;
          pageMarkup = markup;
        }
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

   */
  @Override
  public IMarkupFragment getMarkup(final MarkupContainer container, final Component child)
  {
    // Get the markup to search for the fragment markup
    IMarkupFragment markup = chooseMarkup(container);
    if (markup == null)
    {
      throw new MarkupException("The fragments markup provider has no associated markup. " +
        "No markup to search for fragment markup with id: " + markupId);
    }

    // Search for the fragment markup
    IMarkupFragment childMarkup = markup.find(markupId);
    if (childMarkup == null)
    {
      // There is one more option if the markup provider has associated markup
      MarkupContainer markupProvider = getMarkupProvider(container);
      Markup associatedMarkup = markupProvider.getAssociatedMarkup();
      if (associatedMarkup != null)
      {
        markup = associatedMarkup;
        if (markup != null)
        {
          childMarkup = markup.find(markupId);
        }
      }
    }

    if (childMarkup == null)
    {
      throw new MarkupNotFoundException("No Markup found for Fragment " + markupId +
        " in providing markup container " + markupProvider.toString());
    }

    if (child == null)
    {
      return childMarkup;
    }

    // search for the child insight the fragment markup
    return childMarkup.find(child.getId());
  }
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

   */
  @Override
  public IMarkupFragment getMarkup(final Component child)
  {
    // Border require an associated markup resource file
    IMarkupFragment markup = getAssociatedMarkup();
    if (markup == null)
    {
      throw new MarkupException("Unable to find associated markup file for Border: " +
        this.toString());
    }

    // Find <wicket:border>
    IMarkupFragment borderMarkup = null;
    for (int i = 0; i < markup.size(); i++)
    {
      MarkupElement elem = markup.get(i);
      if (TagUtils.isWicketBorderTag(elem))
      {
        borderMarkup = new MarkupFragment(markup, i);
        break;
      }
    }

    if (borderMarkup == null)
    {
      throw new MarkupException(markup.getMarkupResourceStream(),
        "Unable to find <wicket:border> tag in associated markup file for Border: " +
          this.toString());
    }

    // If child == null, return the markup fragment starting with the <wicket:border> tag
    if (child == null)
    {
      return borderMarkup;
    }

    // Is child == BorderBody?
    if (child == body)
    {
      // Get the <wicket:body> markup
      return body.getMarkup();
    }

    // Find the markup for the child component
    IMarkupFragment childMarkup = borderMarkup.find(child.getId());
    if (childMarkup != null)
    {
      return childMarkup;
    }

View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

        // which gets stripped from output
        markupStream.skipRawMarkup();
      }

      // Get the <span wicket:id="myBorder"> markup and render that instead
      IMarkupFragment markup = Border.this.getMarkup();
      MarkupStream stream = new MarkupStream(markup);
      ComponentTag tag = stream.getTag();
      stream.next();

      super.onComponentTagBody(stream, tag);
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

     * Get the child markup which must be in between the &lt;span wicktet:id="myBorder"&gt; tags
     */
    @Override
    public IMarkupFragment getMarkup(final Component child)
    {
      IMarkupFragment markup = Border.this.getMarkup();
      if (markup == null)
      {
        return null;
      }

      if (child == null)
      {
        return markup;
      }

      return markup.find(child.getId());
    }
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

  @Override
  public IMarkupFragment getMarkup(final MarkupContainer parent, final Component child)
  {
    Args.notNull(tagName, "tagName");

    IMarkupFragment associatedMarkup = parent.getAssociatedMarkup();
    if (associatedMarkup == null)
    {
      throw new MarkupNotFoundException("Failed to find markup file associated. " +
        parent.getClass().getSimpleName() + ": " + parent.toString());
    }

    // Find <wicket:panel>
    IMarkupFragment markup = findStartTag(associatedMarkup);
    if (markup == null)
    {
      throw new MarkupNotFoundException("Expected to find <wicket:" + tagName +
        "> in associated markup file. Markup: " + associatedMarkup.toString());
    }

    // If child == null, than return the markup fragment starting with <wicket:panel>
    if (child == null)
    {
      return markup;
    }

    // Find the markup for the child component
    associatedMarkup = markup.find(child.getId());
    if (associatedMarkup != null)
    {
      return associatedMarkup;
    }
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

   */
  public IMarkupFragment findMarkupInAssociatedFileHeader(final MarkupContainer container,
    final Component child)
  {
    // Get the associated markup
    IMarkupFragment markup = container.getAssociatedMarkup();
    IMarkupFragment childMarkup = null;

    // MarkupStream is good at searching markup
    MarkupStream stream = new MarkupStream(markup);
    while (stream.skipUntil(ComponentTag.class) && (childMarkup == null))
    {
View Full Code Here

Examples of org.apache.wicket.markup.IMarkupFragment

   *            If true, throw an exception, if markup could not be found
   * @return A stream of MarkupElement elements
   */
  public MarkupStream getAssociatedMarkupStream(final boolean throwException)
  {
    IMarkupFragment markup = getAssociatedMarkup();

    // If we found markup for this container
    if (markup != null)
    {
      return new MarkupStream(markup);
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.