Search code examples
javaeclipsercpdraw2d

Re-aligning text in Eclipse Draw2D Label


I am building an RCP-based application with Draw2D Labels (Figures with text). When my graphical editor re-sizes the label, the text stays in it's initial position. Is there anyway to have the text reposition based on the new constraints of the label?


Solution

  • It turns out you just need to use the setConstriants(IFigure parent, Rectangle bounds) method to set the bounds of the label that is residing on top of the parent figure.