[[BackLinksMenu]] [[TicketQuery(summary=TEXT_VIEW_MODEL, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == * After the TEXT_MODEL_REDESIGN task the positions of the caret and mark in the text views are not updating. * The text links and the search highlights are not visualizing. After the task these two bugs shold be fixed. == Task requirements == * Fix the updating of the caret, mark and search highlights position. * Implement search highlight visualization in the text views. * Implement link attachment visualization (as foreground color) in the text views. == Task result == The result should be code. == Implementation idea == * Create a new class related to the text views that updates the indexes. * Create processors to help text layout draw the search highlights. * The processors add some attributes to the raw text (the text in the model) and produce a final text with all attributes added (as highlights and selection etc.) that can be laid out. == Related == [wiki:TEXT_MODEL_REDESIGN] == How to demo == * Run sophie, insert text frame, type some text, select some of the text. * Run sophie, insert text frame, type some text, add text link. * Run sophie, insert text frame, search an existing word from the search palette. = Design = * Make interface TextProcessor. It will have: * Empty interface Options. This is the criteria for processing the text, e.g. highlight color, caret position, highlight interval, etc. * 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). * public ImmText getText(); * 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 :) * 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'. * Make interface TextProcessotProvider: '''description'''. * Register extension point for TextProcessorProviders in BaseTextModule. * Implement selection processor * Implement text search processor * Implement text link processor * Make abstract class TextViewModel: * public abstract ImmText getRawText(); * public abstract ImmText getProcessedText(); * public abstract int getCaret(); * public abstract int getMark(); * public abstract ImmList getAreas(); * public abstract boolean isEditable(); * public abstract HotLayout getTextLayout(); * public RwProp inputStyle(); * public HotTextInterval getSelectionInterval(); * public RwProp wantedX(); * public abstract Prop> attachmentMap(); * replace TextViewFlow with TextViewModel = Implementation = ^(Describe and link the implementation results here (from the wiki or the repository).)^ = Testing = ^(Place the testing results here.)^ = Comments = ^(Write comments for this or later revisions here.)