[brailleblaster] Re: JFace ProjectionViewer looking good

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Mon, 13 Jun 2011 19:22:01 -0700

Pretty cool! I wonder what the javadoc meant when it said that "NOTE: The ProjectionViewer only supports projections that cover full lines. "...


If for whatever reason the "full lines" thing causes JFace to not work as hoped/expected, it should be fairly easy to implement a basic controller class that uses the Observer class and Observable interface from the java.util package...


On Jun 13, 2011, at 5:43 PM, Susan Jolly wrote:

OK, it looks as though the Annotations may not be relevant but that the ProjectionViewer is useful.

I've written a short stand-alone Java code testing out the ProjectionViewer functionality.

The code creates a GUI using two ProjectionViewers which each provide their own StyledText widgets. I created one master document with three lines. I made two ProjectionDocuments (slaves) from this master. I then deleted one line from one of the ProjectionDocuments and a different line from the other one. I set one of these ProjectionDocuments as the input to one of the viewers and the other as input to the other viewer. Each view showed the expected two lines of the master document. The master document was properly updated no matter which view I edited. Moreover, when I edited the line that was common to both views, it instantly updated in the other view.

JFace took care of all this. I didn't end up needing much code but, as is typical, it took me quite a while to discover the right approach and to deal with quirks that aren't obvious from the documentation.

I probably won't do any more work on this tonight.

If I'm not fooling myself it should be possible to use a UTDML document directly as a master document if you figure out how to not display the markup.

Susan



Other related posts: