Creating a list format dialog

Switching lists on and off as described in the previous chapter formats lists in their default formatting as defined in the style sheet of respective document (i.e. applies tags <ul> and <ol> without additional attributes). To adjust list formatting, additional functionality is needed.

To change list formatting, a dialog is created acting on both list attributes and list elements.

When changing an existing ordered list from number to letter ordering for instance, attributes of the list are to be changed. When switching from an existing list ordered by numbers to an unordered bullet list with square bullet symbol, the list element itself and its attributes are to be changed in one step.

Re-use of existing parts

List formatting functionality in part is similar to what has been implemented for table formatting already. Consequently, some of the existing functionality of SimplyHTML can be re-used: Classes DialogShell, AttributeComboBox and BoundariesPanel which share common classes to work with attributes and attribute sets themselves. In stage 6 class AttributeComboBox has been turned into an own class from the former inner class in class TableDialog.

New parts to implement

To create the new list format dialog, class ListDialog is created extending class DialogShell. Class ListDialog is a container for the class showing the actual list attributes, new class ListPanel. Class ListPanel in turn uses classes AttributeComboBox and BoundariesPanel to make available respective list attributes.

How the list attributes actually are shown and changed is implemented exactly the same as in class TableDialog.

To apply list attributes as set with ListDialog, a new method applyListAttributes is added to class SHTMLEditorPane which is again similar to what applyTableAttributes does.