This visits the format tree, pre-creating and collecting the zero dimension format instances for those formats which are accessible directly via PAPI - i.e Panes, Fragments and FormFragments (but not Dissecting Panes).
These format instances are then used to create the PAPI Facades for the formats before being given back to the user.
This is required because the all the PAPI accessible formats are required to be available as soon as the canvas is created, rather than as they are individually referenced in the XDIME/PAPI, as would be the case otherwise.
NOTE: This is rather nasty, for the following reasons:
- The original idea of being able to access formats via PAPI is dubious.
- The PAPI accessible Formats are given Facade classes in the PAPI package with inconsistent names (some of which duplicate the related format names).
- Since the PAPI formats were added, we have added format iterators which confuses the issue. For example, it is impossible to provide access to all the format instances in an iterated format as we do not know how many there will be.
- It relies on the fact that we can use the zero dimension format context instance to represent all the format instance instances. This only works for Panes because the context is not used and the values are stored directly into the pane (which is itself a bug), and for Fragments and FormFragments because these are currently not iterated. The real fix for this is to invent an object which stores the state which is common to all format instances.
- Support for Dissecting Panes is implemented differently, and in a more standard fashion, for some reason(s) which are now lost in the mists of time. It relies on the normal FormatScopes for looking up the pane and pane context.
@see com.volantis.mcs.papi.PaneFormat
@see com.volantis.mcs.papi.Fragment
@see com.volantis.mcs.papi.FormFragment
@see com.volantis.mcs.papi.DissectingPane
@see com.volantis.mcs.context.MarinerRequestContext#getPaneFormat
@see com.volantis.mcs.context.MarinerRequestContext#getPaneFormats
@see com.volantis.mcs.context.MarinerRequestContext#getFragment
@see com.volantis.mcs.context.MarinerRequestContext#getFragments
@see com.volantis.mcs.context.MarinerRequestContext#getFormFragment
@see com.volantis.mcs.context.MarinerRequestContext#getDissectingPane