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

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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2 M2
    • Fix Version/s: 3.2 M3
    • Component/s: API
    • Labels:
      None
    • Similar issues:

      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

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

              Dates

              • Created:
                Updated:
                Resolved: