Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-134

Make it easier to use the Rendering Block API for getBlocks/getFirstBlock

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.2 M3
    • 3.2 M2
    • API
    • None

    Description

      For example instead of having to write:

      List<HeaderBlock> headers = (List) root.getBlocks(new ClassBlockMatcher(HeaderBlock.class), Block.Axes.DESCENDANT);
      
      SectionBlock rootSection = (SectionBlock) context.getCurrentMacroBlock().getFirstBlock(
          new ClassBlockMatcher(SectionBlock.class), Block.Axes.ANCESTOR);
      

      Be able to write:

      List<HeaderBlock> headers = root.getBlocks(new ClassBlockMatcher(HeaderBlock.class), Block.Axes.DESCENDANT);
      
      SectionBlock rootSection = context.getCurrentMacroBlock().getFirstBlock(
          new ClassBlockMatcher(SectionBlock.class), Block.Axes.ANCESTOR);
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: