This locator automatically resolves the MenuBuffer for the given menu entries using a {@link OutputBufferResolver} to translate pane references tooutput buffers. This involves handling automatic iteration allocation where necessary.
Automatic iteration allocation is handled by determining whether the conditions for this are met by an entry's containing menu (see {@link #getAutoAllocatingMenu} and, if so:
- allocate iterations of the menu's format reference for each immediate, untargeted child, storing these in the {@link #allocations} map (see {@link #allocateIterations})
- when determining a format reference for an entry (in {@link #findFormatReferenceFor}) always check for explicit targeting and, if not available, look to see if an allocation for that entry has been recorded in the
allocations
map and if so explicitly use this allocation (otherwise, fall back to any container as needed)
Each top-level menu should use a separate instance of this class.
NOTE: Automatic iteration allocation cannot be performed on the top-most menu if that menu is inheriting its pane specification from surrounding markup.