[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: draw2d.text indent strategy

(It's great when someone posts a question and has looked at the code!)

Do you want a border/margin around a TextFlow or some other InlineFlow?  We
would like to support inline borders maybe in the 3.1 release.  Or, do you
want to process TAB characters and advance the LineBox's current X position
to the next "tab stop"?

If you just want a nested block with a border, you should be able to handle
this at the BlockFigure or its layout.  Perhaps in setupBlock, the
recommended width should substract insets.getWidth()

"Rob Grzywinski" <rgrzywinski@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:cofdq2$tgq$1@xxxxxxxxxxxxxxxxxx
> It is my desire to add various indenting strategies to a FlowFigure.  I
> started off with the standard techniques (i.e. MarginBorder) but it seems
> that IFigure.getInsets() is only accounted for in FlowPage (and not in
> BlockFlow, InlineFlow or TextFlow).
>
> After a bit of research it seems that there are two points during which
> "layout" (as it is needed for indenting) for a TextFlow occurs:
> ParagraphTextLayout.layout (where a line is split into multiple lines as
> necessary) and LineBox.commit (where a line's children are positioned).
> Shrinking the available space that a line has based on getInsets() seems
to
> be trivial in ParagraphTextLayout.  The problem comes in when laying out
the
> children fragments (FlowBoxes) in LineBox;  LineBox knows nothing about
the
> FlowFigure from which it is derived so it cannot know about any indenting
> strategy (e.g. getInsets()).
>
> I am interested in the following:
> o  Is there already work going on for indenting strategies?
> o  Am I on the right track (i.e. do the locations that I've identified
> represent the whole of the problem that I am attempting to solve)?
>
> Thanks!
>
> --
> Rob Grzywinski
>
>