Community
Participate
Working Groups
When a layout manager is set on a text flow it must be done before adding the text flow to its parent otherwise a NullPointerException may result. Example Application: public class OrderBug extends org.eclipse.draw2d.examples.AbstractExample { public static void main(String[] args) { new OrderBug().run(); } protected void sizeShell() { shell.setSize(shell.computeSize(400, 200)); } protected IFigure getContents() { Figure f = new Figure(); f.setLayoutManager(new ToolbarLayout()); f.add(orderBug()); return f; } protected IFigure orderBug() { final boolean die = true; FlowPage fp = new FlowPage(); TextFlow tf = new TextFlow(); if (die) { fp.add(tf); tf.setLayoutManager(new ParagraphTextLayout(tf)); } else { tf.setLayoutManager(new ParagraphTextLayout(tf)); fp.add(tf); } tf.setText("hello"); return fp; } }