Bug 56957 [Encoding] Reusable EncodingFieldEditor
I have added the ability to set an encoding for a repository so that commit messages and file names can be properly translated between a client and server whose encodings differ. I have extracted much of the code from IDEEditorsPreferencePage into an EncodingFieldEditor class so I could us it. I was planning on providing a patch to the UI with the hope that this class could be API but there is a roadblock that prevents this. Basically, the encoding preference is in a org.eclipse.core.Preferences node but a field editor requires an IPreferenceStore. There are already two adapters for this is the platform but one is a private inner class of AbstractUIPlugin and the other lives in the text plugin. Instead of creating a patch, I'm just attaching the EncodingFieldEditor class for future consideration.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/ResourceInfoPage.java
private boolean previousReadOnlyValue;
	private boolean previousDerivedValue;
	private IContentDescription cachedContentDescription;
	private Combo encodingCombo;
	private Button defaultEncodingButton;
	private Button otherEncodingButton;
	
	private static String READ_ONLY = IDEWorkbenchMessages
			.getString("ResourceInfo.readOnly"); 
	private static String DERIVED = IDEWorkbenchMessages
			.getString("ResourceInfo.derived"); 
	private static String TYPE_TITLE = IDEWorkbenchMessages
			.getString("ResourceInfo.type"); 
	private static String LOCATION_TITLE = IDEWorkbenchMessages
			.getString("ResourceInfo.location"); 
	private static String RESOLVED_LOCATION_TITLE = IDEWorkbenchMessages
			.getString("ResourceInfo.resolvedLocation"); 
	private static String SIZE_TITLE = IDEWorkbenchMessages
			.getString("ResourceInfo.size"); 
	private static String BYTES_LABEL = IDEWorkbenchMessages
			.getString("ResourceInfo.bytes"); 
	private static String FILE_LABEL = IDEWorkbenchMessages
			.getString("ResourceInfo.file"); 
	private static String FILE_TYPE_FORMAT = IDEWorkbenchMessages
			.getString("ResourceInfo.fileTypeFormat"); 
	private static String FOLDER_LABEL = IDEWorkbenchMessages
			.getString("ResourceInfo.folder"); 
	private static String PROJECT_LABEL = IDEWorkbenchMessages
			.getString("ResourceInfo.project"); 
	private static String LINKED_FILE_LABEL = IDEWorkbenchMessages