Class FieldEditorPreferencePage
- All Implemented Interfaces:
EventListener,IDialogPage,IMessageProvider,IPreferencePage,IPropertyChangeListener
- Direct Known Subclasses:
TextEditorPreferencePage
Subclasses must implement the createFieldEditors method
and should override createLayout if a special layout of the field
editors is needed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLayout constant (value0) indicating that each field editor is handled as a single component.static final intLayout constant (value1) indicating that the field editors' basic controls are put into a grid layout.protected static final intThe margin height used by layout stylesFLATandGRID.protected static final intThe margin width used by layout stylesFLATandGRID.protected static final intThe vertical spacing used by layout stylesFLATandGRID.Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a new instance of the receiver.protectedFieldEditorPreferencePage(int style) Creates a new field editor preference page with the given style, an empty title, and no image.protectedFieldEditorPreferencePage(String title, int style) Creates a new field editor preference page with the given title and style, but no image.protectedFieldEditorPreferencePage(String title, ImageDescriptor image, int style) Creates a new field editor preference page with the given title, image, and style. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddField(FieldEditor editor) Adds the given field editor to this page.protected voidAdjust the layout of the field editors so that they are properly aligned.protected voidApplys the font to the field editors managed by this page.protected voidRecomputes the page's error state by callingisValidfor every field editor.protected ControlcreateContents(Composite parent) Creates and returns the SWT control for the customized body of this preference page under the given parent composite.protected abstract voidCreates the page's field editors.voiddispose()The field editor preference page implementation of anIDialogPagemethod disposes of this page's controls and images.protected CompositeReturns a parent composite for a field editor.protected voidInitializes all field editors.protected voidThe field editor preference page implementation of aPreferencePagemethod loads all the field editors with their default values.booleanThe field editor preference page implementation of thisPreferencePagemethod saves all field editors by callingFieldEditor.store.voidThe field editor preference page implementation of thisIPreferencePage(andIPropertyChangeListener) method interceptsIS_VALIDevents but passes other events on to its superclass.voidsetVisible(boolean visible) TheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state.Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButtonMethods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, setDescription, setImageDescriptor
-
Field Details
-
FLAT
public static final int FLATLayout constant (value0) indicating that each field editor is handled as a single component.- See Also:
-
GRID
public static final int GRIDLayout constant (value1) indicating that the field editors' basic controls are put into a grid layout.- See Also:
-
VERTICAL_SPACING
protected static final int VERTICAL_SPACINGThe vertical spacing used by layout stylesFLATandGRID.- See Also:
-
MARGIN_WIDTH
protected static final int MARGIN_WIDTHThe margin width used by layout stylesFLATandGRID.- See Also:
-
MARGIN_HEIGHT
protected static final int MARGIN_HEIGHTThe margin height used by layout stylesFLATandGRID.- See Also:
-
-
Constructor Details
-
FieldEditorPreferencePage
public FieldEditorPreferencePage()Create a new instance of the receiver. -
FieldEditorPreferencePage
protected FieldEditorPreferencePage(int style) Creates a new field editor preference page with the given style, an empty title, and no image.- Parameters:
style- eitherGRIDorFLAT
-
FieldEditorPreferencePage
Creates a new field editor preference page with the given title and style, but no image.- Parameters:
title- the title of this preference pagestyle- eitherGRIDorFLAT
-
FieldEditorPreferencePage
Creates a new field editor preference page with the given title, image, and style.- Parameters:
title- the title of this preference pageimage- the image for this preference page, ornullif nonestyle- eitherGRIDorFLAT
-
-
Method Details
-
addField
Adds the given field editor to this page.- Parameters:
editor- the field editor
-
adjustGridLayout
protected void adjustGridLayout()Adjust the layout of the field editors so that they are properly aligned. -
applyFont
protected void applyFont()Applys the font to the field editors managed by this page. -
checkState
protected void checkState()Recomputes the page's error state by callingisValidfor every field editor. -
createContents
Description copied from class:PreferencePageCreates and returns the SWT control for the customized body of this preference page under the given parent composite.This framework method must be implemented by concrete subclasses. Any subclass returning a
Compositeobject whoseLayouthas default margins (for example, aGridLayout) is expected to set the margins of thisLayoutto 0 pixels.- Specified by:
createContentsin classPreferencePage- Parameters:
parent- the parent composite- Returns:
- the new control
-
createFieldEditors
protected abstract void createFieldEditors()Creates the page's field editors.The default implementation of this framework method does nothing. Subclass must implement this method to create the field editors.
Subclasses should call
getFieldEditorParentto obtain the parent control for each field editor. This same parent should not be used for more than one editor as the parent may change for each field editor depending on the layout style of the page -
dispose
public void dispose()The field editor preference page implementation of anIDialogPagemethod disposes of this page's controls and images. Subclasses may override to release their own allocated SWT resources, but must callsuper.dispose.- Specified by:
disposein interfaceIDialogPage- Overrides:
disposein classDialogPage
-
getFieldEditorParent
Returns a parent composite for a field editor.This value must not be cached since a new parent may be created each time this method called. Thus this method must be called each time a field editor is constructed.
- Returns:
- a parent
-
initialize
protected void initialize()Initializes all field editors. -
performDefaults
protected void performDefaults()The field editor preference page implementation of aPreferencePagemethod loads all the field editors with their default values.- Overrides:
performDefaultsin classPreferencePage
-
performOk
public boolean performOk()The field editor preference page implementation of thisPreferencePagemethod saves all field editors by callingFieldEditor.store. Note that this method does not save the preference store itself; it just stores the values back into the preference store.- Specified by:
performOkin interfaceIPreferencePage- Overrides:
performOkin classPreferencePage- Returns:
falseto abort the container's OK processing andtrueto allow the OK to happen- See Also:
-
propertyChange
The field editor preference page implementation of thisIPreferencePage(andIPropertyChangeListener) method interceptsIS_VALIDevents but passes other events on to its superclass.- Specified by:
propertyChangein interfaceIPropertyChangeListener- Parameters:
event- the property change event object describing which property changed and how
-
setVisible
public void setVisible(boolean visible) Description copied from class:DialogPageTheDialogPageimplementation of thisIDialogPagemethod sets the control to the given visibility state. Subclasses may extend.- Specified by:
setVisiblein interfaceIDialogPage- Overrides:
setVisiblein classDialogPage- Parameters:
visible-trueto make this page visible, andfalseto hide it
-