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
private final int fMinValue, fMaxValue;
		private final Label fNumberLabel;
		private final Text fNumberText;
		protected int fSelected;
        protected int fOldSelected;
        
        
		/**
		 * Create a new NumberPreference.
		 * @param composite The composite on which the SWT widgets are added.
		 * @param numColumns The number of columns in the composite's GridLayout.
		 * @param preferences The map to store the values.
		 * @param key The key to store the values.
		 * @param minValue The minimum value which is valid input.
		 * @param maxValue The maximum value which is valid input.
		 * @param text The label text for this Preference.
		 */
		public NumberPreference(Composite composite, int numColumns,
							   Map preferences, String key, 
							   int minValue, int maxValue, String text) {
		    super(preferences, key);
		    
			fNumberLabel= createLabel(numColumns - 1, composite, text, GridData.FILL_HORIZONTAL);
			fNumberText= new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.RIGHT);
			final int length= Integer.toString(maxValue).length() + 3; 
			fNumberText.setLayoutData(createGridData(1, GridData.HORIZONTAL_ALIGN_END, fPixelConverter.convertWidthInCharsToPixels(length)));