29 | | ^(Describe your design here.)^ |
| 29 | Two new modules are created: one for importing plain text documents and the other - for importing rtf documents. |
| 30 | The html modole is extended with functionality for importing html documents. |
| 31 | A new abstract class ImportUtil is created with the following methods: |
| 32 | * handleHelper - helper fo the handle function of each newly created modules. |
| 33 | * insertFrame - inserts a new Frame in the current book |
| 34 | * createHotTextBookResource - creates HotTextBookResource for insert operation. |
| 35 | * abstract method createRes - fills the HotTextBookResource with appropriate content for each import module. |
| 36 | Each module has RtfImportUtil/HtmlImportUtil/PlainTextImportUtil which extends this class and cretes appropriate content for the |
| 37 | newly added HotTextBookResource. |
| 38 | A new abstract class is added ApplyStyles with the following functions: |
| 39 | * applyStyles - apply styles recurselively to its HotText parameter according to the html/rtf tags. |
| 40 | * abstract method getCorrespondingVal - returns the corresponding CommonAttr with value for each tag in html/rtf document. |
| 41 | The module for importing rtf documents and the module for importing html documents have the following class: |
| 42 | * ApplyRtfStyles/ApplyHtmlStyles - extends ApplyStyles and use AttributedPair class to get the corresponding CommonAttr for each |
| 43 | pair tag/attribute. |
| 44 | Each of the modules for importing rtf/html uses RTFEditorKit/HTMLEditorKit to get the attributes from the html/rtf document. |