41 | | * Make interface TextProcessor: '''description'''. |
| 41 | * Make interface TextProcessor. It will have: |
| 42 | * Empty interface Options. This is the criteria for processing the text, e.g. highlight color, caret position, highlight interval, etc. |
| 43 | * Interface Effect. This consists of the resulting text after a processing and the change that is generated from it (the change that if applied to the raw text, the processed one will be the result). |
| 44 | * public ImmText getText(); |
| 45 | * public TextStyleChange getChange(); Note that the result is a Style change, that is, the processors will not e able to modify the text itself, but only its styles. Otherwise, weird navigation problems could occur with the current implementation :) |
| 46 | * ImmText process(ImmText sourceText, T procOptions); You give the processor a text and the rules for processing, then it returns the processed text. For example: TextSelectionProcessor, which has text 'abc' and options 'caret: 2, mark:1, color: red' will return 'abc' with colored in green 'b' and 'c', as well as a caret after the 'c'. |