Package com.iizigo.project
Class StandardPropertyPage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
org.eclipse.ui.dialogs.PropertyPage
com.iizigo.project.StandardPropertyPage
- All Implemented Interfaces:
IDialogPage,IMessageProvider,IPreferencePage,IWorkbenchPropertyPage
- Direct Known Subclasses:
AliasPropertyPage,TerminalModelPropertyPage
The standard property page with a fix for the Apply button and changed-support with saving settings.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNINGConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected abstract StringcheckSelectedElement(Object element) Initializes the page for the selected object if it's of correct type and contents.protected final voidClears the change state.protected ControlcreateContents(Composite parent) protected abstract voidcreateContents(Composite composite, int parentWidth, int stdButtonWidth) The real creator must be overridden.final voidcreateControl(Composite parent) OVerrides the default to disable Apply button.protected final voidPerforms apply.final booleanPerforms OK.protected abstract booleanSave settings.protected final voidSets the change state.protected voidsetDefaultsEnabled(boolean on) Sets the Defaults button enabled state.protected final voidOverrides the default behavior to updates the enabled state of the Apply button to reflect whether this page is valid.Methods inherited from class org.eclipse.ui.dialogs.PropertyPage
getElement, setElementMethods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performCancel, performDefaults, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toStringMethods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisibleMethods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
Constructor Details
StandardPropertyPage
public StandardPropertyPage()Constructor.
Method Details
createControl
OVerrides the default to disable Apply button.- Specified by:
createControlin interfaceIDialogPage- Overrides:
createControlin classPreferencePage
checkSelectedElement
Initializes the page for the selected object if it's of correct type and contents. If not, return an error message.- Parameters:
element- The selected element (normally from the Common Navigator).- Returns:
- Error message, or null for OK.
createContents
- Specified by:
createContentsin classPreferencePage- See Also:
createContents
The real creator must be overridden. The composite is created with no layout.- Parameters:
composite- The composite to fill with controls.parentWidth- The parent width.stdButtonWidth- The standard button width (Apply, Defaults).
saveSettings
protected abstract boolean saveSettings()Save settings. Override to save settings.- Returns:
- false for failure, OK to keep on going.
performApply
protected final void performApply()Performs apply. Cannot be overridden, saves settings if required.- Overrides:
performApplyin classPreferencePage
performOk
public final boolean performOk()Performs OK. Cannot be overridden, saves settings if required.- Specified by:
performOkin interfaceIPreferencePage- Overrides:
performOkin classPreferencePage
clearChanged
protected final void clearChanged()Clears the change state.setChanged
protected final void setChanged()Sets the change state.updateApplyButton
protected final void updateApplyButton()Overrides the default behavior to updates the enabled state of the Apply button to reflect whether this page is valid.- Overrides:
updateApplyButtonin classPreferencePage
setDefaultsEnabled
protected void setDefaultsEnabled(boolean on) Sets the Defaults button enabled state. If the Defaults button is not created, this method does nothing.