public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int marginWidth, int marginHeight) { int nCulumns= getNumberOfColumns(editors); Control[][] controls= new Control[editors.length][]; for (int i= 0; i < editors.length; i++) { controls[i]= editors[i].doFillIntoGrid(parent, nCulumns); } if (labelOnTop) { nCulumns--; modifyLabelSpans(controls, nCulumns); } GridLayout layout= null; if (parent.getLayout() instanceof GridLayout) { layout= (GridLayout) parent.getLayout(); } else { layout= new GridLayout(); } if (marginWidth != SWT.DEFAULT) { layout.marginWidth= marginWidth; } if (marginHeight != SWT.DEFAULT) { layout.marginHeight= marginHeight; } layout.numColumns= nCulumns; parent.setLayout(layout);
public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop) { doDefaultLayout(parent, editors, labelOnTop, 0, 0);
	public static void doDefaultLayout(Composite parent, DialogField[] editors, boolean labelOnTop, int marginWidth, int marginHeight) {		int nCulumns= getNumberOfColumns(editors);		Control[][] controls= new Control[editors.length][];		for (int i= 0; i < editors.length; i++) {			controls[i]= editors[i].doFillIntoGrid(parent, nCulumns);		}		if (labelOnTop) {			nCulumns--;			modifyLabelSpans(controls, nCulumns);		}		GridLayout layout= null;		if (parent.getLayout() instanceof GridLayout) {			layout= (GridLayout) parent.getLayout();		} else {			layout= new GridLayout();		}		if (marginWidth != SWT.DEFAULT) {			layout.marginWidth= marginWidth;		}		if (marginHeight != SWT.DEFAULT) {			layout.marginHeight= marginHeight;		}		layout.numColumns= nCulumns;				parent.setLayout(layout);	}