Called when the fragment is created. Initializes the fragment configuration, document sources, and undo manager.
If non-null, the fragment is being re-constructed from a previous saved state.