[brailleblaster] Re: JFace and MVC for SWT widgets

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Mon, 13 Jun 2011 14:43:33 -0700

I think you're correct in saying that Annotations relate to content in the master document, and I think a similar concept may be the correct approach for BrailleBlaster - I'm just not sure that you'd want to use Annotations for this particular purpose.


The ProjectionAnnotation class used in the code you referenced is meant specifically for folding text. Looking at the Annotation class (the parent of ProjectionAnnotation) and its subclasses I see getText() and setText() methods, which implies to me that the Annotation actually contains the text in question and therefore has the same problem as loading text into a StyledText control. According to its javadoc ProjectionViewer (the viewer used to display a projection) only supports projections that cover full lines, not fragments of lines - that might make it problematic to use that view to display text and braille.


Cheers
Chris

On Jun 13, 2011, at 2:15 PM, Susan Jolly wrote:

My understanding is that the annotations are what makes it possible to relate a Projection in a viewer back to a master document. I think if you used two TextViewers you'd essentially have separate master documents and you'd lose the relationship between them. But I could be completely wrong.

Susan



Other related posts: