Implementing list formatting in SimplyHTML

As described in the introduction of stage 6, to apply list formatting in SimplyHTML the requirement is to offer a simple way to switch list formatting on or off for an arbitrary portion of existing text paragraphs. As well there should be a way to change formatting of an existing list partly or completely through a separate dialog.

While parts of previous stages of SimplyHTML can be re-used to achieve list formatting through a dialog, a certain difficulty is to change an arbitrary portion of existing text to list formatting because the element structure of the existing document content has to be changed.

Changing the element structure

The only way to change the element structure of an HTML document which is publicly available in the Java classes is to insert HTML code replacing a given part of respective document. SimplyHTML uses class SHTMLWriter to synthesize HTML code as already done in table formatting. The process is described in more detail in the following chapters. Please see the source code of stage 6 for additional details.