The MWReferenceDialog from the Cite codebase is responsible for all things related to adding, editing and re-using references and includes a lot of code to build the UI for all three use cases. Extracting some of the logic to separate widgets would help in general there. - But furthermore Cite-Extends also needs a dialog so that users can set the additional content and would profit a lot from a re-usable widget that encapsulates everything that's relevant to set and manipulate a reference's content.
Implementation ideas:
Extract a widget ( probably as TabPanelLayout ) that
- builds the editor interface
- can be used for creating, editing and extending references
- is responsible for the re-use and extends warnings on editing