Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] status of org.eclipse.gef.examples.text

I was interested in seeing whether a richer text model could be incorporated 
into my developing GEF editor -- so that the contents of certain edit parts 
could have richer text (with bold, underlining, lists, etc etc), and to that 
end I have been looking at org.eclipse.gef.examples.text.

It doesn't seem to be quite ready for prime time as of yet.  I found quite 
quickly at several errors in the behaviour:

(a) when I highlighted a block of text and clicked on the "bold" button the 
window was redrawn with the bolded text shown on a line by itself.  If, for 
example, I highlighted the word "embolden" in the text "I am trying to embolden 
a part of this text" I got as a result:

I am trying to
embolden
a part of this text.

This seemed to stop happening (although, of course, this is not necessarily the
proper answer), by commenting out two lines in TextFlowPart that wanted to set 
the TextFlow figure's layout manager to "SimpleTextLayout".

(b) If I then tried to add a second attribute to the same block of text (now, 
tried to add "italics" to the word "embolden", a runtime exception was thown 
(apparently the one in the TextFlowPart's CaretInfo method

(c) If I tried to select a portion of some bolded text, and clicked on the bold
button -- to "un-bold" it -- nothing seemed to happen

It, thus, seemed to me that the code shown here was really still under 
development.  I'd still love, however, to be able to use some of this material 
to provide rich text support in my GEF application.  I noted plans for 
upgrading the text support, and it seemed to be a part of the plans for GEF 
3.2.  What is the status of the code as I find it in 3.1.1 now??

A further question -- I wasn't sure how to set things up so that the text 
facilities (the TextTool, and perhaps other components) would come into play 
only in edit parts that contain the text.  In a really clumsy way, I tried 
setting the text tool as the default tool whenever the mouse entered the figure
associated with the enriched thext, and then resetting the tool to whatever it 
was when the mouse left the figure again -- but this seemed dubious at best -- 
although it did seem to work reasonably well.  What should I do instead?

Best wishes.                                 ... john bradley


Back to the top