Approach to work with paragraph and named styles
As pointed out, style manipulation functionality is already exisiting in the Java classes and the previous stages of application SimplyHTML. What is needed in addition is a GUI to visualize the existing styles and to let the user add new, change existing or delete styles.
Dialog to manipulate styles
Class ParaStyleDialog is added to SimplyHTML as a new component to achieve this. Class ParaStyleDialog has two major functions:
Because both tasks require the same elements (components to reflect settings of paragraph attributes), they are combined inside class ParaStyleDialog and made available as two separate operation modes of the component.
Components to select named styles and alignment
To make available existing named styles for paragraphs as defined in the style sheet, class StyleSelector is created. It shows all available named paragraph styles and lets the user apply a given style to the currently selected paragraph(s).
A paragraph attribute which is used quite often is the text alignment setting (left, center or right). For setting text alignmen in one step, inner class ToggleFontAction has been changed to class ToggleAction and can now can be used as a generic action to toggle certain character and paragraph attributes including text aligment. The new action is used by SimplyHTML's dynamic resource mechanism to add respective toggle button components to the tool bar.
Style sheet storage
As stage 8 allows to change contents of a given style sheet, the way a style sheet is saved has to be revised. When a document is saved, SimplyHTML now recogniszes whether or not a style sheet with the same name exists in the location where a document is to be saved.
Is a style sheet present already, it is merged with the style sheet to be saved.