Package org.eclipse.ui.ide.dialogs
Class ResourceEncodingFieldEditor
java.lang.Object
org.eclipse.jface.preference.FieldEditor
org.eclipse.ui.ide.dialogs.AbstractEncodingFieldEditor
org.eclipse.ui.ide.dialogs.ResourceEncodingFieldEditor
The ResourceEncodingFieldEditor is a field editor for editing the encoding of
a resource and does not use a preference store.
This class may be instantiated; it is not intended to be subclassed.
- Since:
- 3.1
-
Field Summary
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE -
Constructor Summary
ConstructorsConstructorDescriptionResourceEncodingFieldEditor(String labelText, Composite parent, IResource charsetResource) Creates a new encoding field editor for setting the encoding on the given resource.ResourceEncodingFieldEditor(String labelText, Composite parent, IResource charsetResource, String groupTitle) Creates a new encoding field editor for setting the encoding on the given resource. -
Method Summary
Modifier and TypeMethodDescriptionprotected CompositecreateEncodingGroup(Composite parent, int numColumns) Creates a composite with all the encoding controls.protected StringReturns the text for the default encoding button.protected voidInitializes this field editor with the default preference value from the preference store.protected voiddoStore()Stores the preference value from this field editor into the preference store.protected StringReturns the default encoding for the object being shown.protected StringReturns the value that is currently stored for the encoding.voidload()Initializes this field editor with the preference value from the preference store.voidInitializes this field editor with the default preference value from the preference store.voidsetEnabled(boolean enabled, Composite parent) Set whether or not the controls in the field editor are enabled.voidstore()Stores this field editor's value back into the preference store.Methods inherited from class org.eclipse.ui.ide.dialogs.AbstractEncodingFieldEditor
adjustForNumColumns, doFillIntoGrid, doLoad, getDefaultEnc, getNumberOfControls, getSelectedEncoding, hasSameEncoding, isValid, refreshValidState, setGroupTitle, setPreferenceStoreMethods inherited from class org.eclipse.jface.preference.FieldEditor
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, presentsDefaultValue, setButtonLayoutData, setFocus, setLabelText, setPage, setPreferenceName, setPreferencePage, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage
-
Constructor Details
-
ResourceEncodingFieldEditor
Creates a new encoding field editor for setting the encoding on the given resource.- Parameters:
labelText- the label text of the field editorparent- the parent of the field editor's controlcharsetResource- must be anIContaineror anIFile.- See Also:
-
ResourceEncodingFieldEditor
public ResourceEncodingFieldEditor(String labelText, Composite parent, IResource charsetResource, String groupTitle) Creates a new encoding field editor for setting the encoding on the given resource.- Parameters:
labelText- the label text of the field editorparent- the parent of the field editor's controlcharsetResource- must be anIContaineror anIFile.groupTitle- the title for the field editor's control. If groupTitle isnullthe control will be unlabelled (by default aCompositeinstead of aGroup.- Since:
- 3.3
- See Also:
-
-
Method Details
-
getStoredValue
Description copied from class:AbstractEncodingFieldEditorReturns the value that is currently stored for the encoding.- Specified by:
getStoredValuein classAbstractEncodingFieldEditor- Returns:
- the currently stored encoding
-
doStore
protected void doStore()Description copied from class:FieldEditorStores the preference value from this field editor into the preference store.Subclasses must implement this method to save the entered value into the preference store.
- Specified by:
doStorein classFieldEditor
-
store
public void store()Description copied from class:FieldEditorStores this field editor's value back into the preference store.- Overrides:
storein classFieldEditor
-
load
public void load()Description copied from class:FieldEditorInitializes this field editor with the preference value from the preference store.- Overrides:
loadin classFieldEditor
-
loadDefault
public void loadDefault()Description copied from class:FieldEditorInitializes this field editor with the default preference value from the preference store.- Overrides:
loadDefaultin classFieldEditor
-
doLoadDefault
protected void doLoadDefault()Description copied from class:FieldEditorInitializes this field editor with the default preference value from the preference store.Subclasses must implement this method to properly initialize the field editor.
- Overrides:
doLoadDefaultin classAbstractEncodingFieldEditor
-
findDefaultEncoding
Description copied from class:AbstractEncodingFieldEditorReturns the default encoding for the object being shown.- Overrides:
findDefaultEncodingin classAbstractEncodingFieldEditor- Returns:
- the default encoding for the object being shown
-
defaultButtonText
Description copied from class:AbstractEncodingFieldEditorReturns the text for the default encoding button.- Overrides:
defaultButtonTextin classAbstractEncodingFieldEditor- Returns:
- the text for the default encoding button
-
createEncodingGroup
Description copied from class:AbstractEncodingFieldEditorCreates a composite with all the encoding controls.Subclasses may extend.
- Overrides:
createEncodingGroupin classAbstractEncodingFieldEditor- Parameters:
parent- the parent widgetnumColumns- the number of columns in the parent- Returns:
- the group control
-
setEnabled
Description copied from class:FieldEditorSet whether or not the controls in the field editor are enabled.- Overrides:
setEnabledin classAbstractEncodingFieldEditor- Parameters:
enabled- The enabled state.parent- The parent of the controls in the group. Used to create the controls if required.
-