Bug 77636 Code Formatter Profile Editor should be more fault-tolerant [formatter]
200411022000 The Code Formatter Profile Editor should be more fault-tolerant. Especially on 'White Space' and 'Line Wrapping' tabs, it is very easy to mess things up by changing many settings at once with a single click at the wrong spot. Two possible solutions came to my mind: (1) The dialog could support an undo/redo-stack (via keybindings and/or via additional buttons on the bottom row) (2) The dialog could offer an 'Apply' button, with which the user could save the changes done so far. The current workaround for this is to leave the dialog via OK and then re-enter it, but that's cumbersome when you want to do a pass over all options.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ModifyDialogTabPage.java
/**
     * Set the status field on the dialog. This can be used by tab pages to report 
     * inconsistent input. The OK button is disabled if the kind is IStatus.ERROR. 
     * @param status Status describing the current page error state
     */
	protected void updateStatus(IStatus status) {
	    fModifyDialog.updateStatus(status);
	}
	
	/*
	 * Factory methods to make GUI construction easier
	 */
	
	/*
	 * Create a GridLayout with the default margin and spacing settings, as
	 * well as the specified number of columns.
	 */
	protected GridLayout createGridLayout(int numColumns, boolean margins) {
		final GridLayout layout= new GridLayout(numColumns, false);
		layout.verticalSpacing= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
		layout.horizontalSpacing= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
		if (margins) {
			layout.marginHeight= fPixelConverter.convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
			layout.marginWidth= fPixelConverter.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
		} else {
			layout.marginHeight= 0;
			layout.marginWidth= 0;
		}
		return layout;
	}