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
s= ""; 
			    }
			    fNumberText.setText(s);
			} else {
			    fNumberText.setText(""); 
			}
		}
		
		public Control getControl() {
			return fNumberText;
		}
	}
	
	/**
	 * This class provides the default way to preserve and re-establish the focus
	 * over multiple modify sessions. Each ModifyDialogTabPage has its own instance,
	 * and it should add all relevant controls upon creation, always in the same sequence.
	 * This established a mapping of controls to indexes, which allows to restore the focus
	 * in a later session. 
	 * The index is saved in the dialog settings, and there is only one common preference for 
	 * all tab pages. It is always the currently active tab page which stores its focus
	 * index. 
	 */
	protected final static class DefaultFocusManager extends FocusAdapter {
		
		private final static String PREF_LAST_FOCUS_INDEX= JavaUI.ID_PLUGIN + "formatter_page.modify_dialog_tab_page.last_focus_index";  
		
		private final IDialogSettings fDialogSettings;
		
		private final Map fItemMap;