Bug 276202 [Forms] NPE if dispose() called on FormToolkit more than once
Build id: I20090512-2000 java.lang.NullPointerException at org.eclipse.ui.forms.widgets.FormToolkit.dispose(FormToolkit.java:711) At the moment, if you invoke dispose() twice on a FormToolkit instance, an NPE will be thrown. public void dispose() { if (colors.isShared() == false) { colors.dispose(); colors = null; } boldFontHolder.dispose(); } As can be seen, the 'colors' field is set to 'null' which is the cause of the NPE. It's okay to repeatedly invoke dispose() on an SWT widget so I feel this pattern should be extended for a FormToolkit also.
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormToolkit.java
* margin width and height must be chosen to allow the toolkit to paint the
	 * border on the parent around the widgets.
	 * <p>
	 * Borders are painted for some controls that are selected by the toolkit by
	 * default. If a control needs a border but is not on its list, it is
	 * possible to force borders in the following ways:
	 * 
	 * <pre>
	 *             widget.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
	 *             
	 *             or
	 *             
	 *             widget.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
	 * </pre>
	 * <p>
	 * If borders would normally be painted for a control, but they are not wanted, it
	 * is possible to suppress them in the following way:
	 * 
	 * <pre>
	 *             widget.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
	 * </pre>
	 * 
	 * @param parent
	 *            the parent that owns the children for which the border needs
	 *            to be painted.
	 */
	public void paintBordersFor(Composite parent) {
		
		
		if (borderPainter == null)