Class StyleSelector

Class StyleSelector is a component used to make available a list of existing named paragraph styles and to apply a named style to the currently selected paragraph(s). It extends class JComboBox by implementing interfaces AttributeComponent and ChangeListener.

Added to a tool bar its method getValue allows access to the currently set style while method setValue can be used to reflect the style of the paragraph the caret is currently in.

As described in more detail in the next chapter, class StyleSelector listens to changes in the JTabbedPane of class FrmMain and to changes of a given style sheet. Whenever the JTabbedPane or the style sheet changes (i.e. another document is active or the styles have changed), the list of named paragraph styles in the StyleSelector is updated.