Class StandardPropertyPage

  • All Implemented Interfaces:
    org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPropertyPage
    Direct Known Subclasses:
    AliasPropertyPage, TerminalModelPropertyPage

    public abstract class StandardPropertyPage
    extends org.eclipse.ui.dialogs.PropertyPage
    The standard property page with a fix for the Apply button and changed-support with saving settings.
    Christopher Mindus
    • Field Summary

      • Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.String checkSelectedElement​(java.lang.Object element)
      Initializes the page for the selected object if it's of correct type and contents.
      protected void clearChanged()
      Clears the change state.
      protected org.eclipse.swt.widgets.Control createContents​(org.eclipse.swt.widgets.Composite parent)  
      protected abstract void createContents​(org.eclipse.swt.widgets.Composite composite, int parentWidth, int stdButtonWidth)
      The real creator must be overridden.
      void createControl​(org.eclipse.swt.widgets.Composite parent)
      OVerrides the default to disable Apply button.
      protected void performApply()
      Performs apply.
      boolean performOk()
      Performs OK.
      protected abstract boolean saveSettings()
      Save settings.
      protected void setChanged()
      Sets the change state.
      protected void setDefaultsEnabled​(boolean on)
      Sets the Defaults button enabled state.
      protected void updateApplyButton()
      Overrides 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, setElement
      • Methods 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, toString
      • Methods 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, setVisible
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage

        dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
      • Methods inherited from interface org.eclipse.jface.preference.IPreferencePage

        computeSize, isValid, okToLeave, performCancel, setContainer, setSize
    • Constructor Detail

      • StandardPropertyPage

        public StandardPropertyPage()
    • Method Detail

      • createControl

        public final void createControl​(org.eclipse.swt.widgets.Composite parent)
        OVerrides the default to disable Apply button.
        Specified by:
        createControl in interface org.eclipse.jface.dialogs.IDialogPage
        createControl in class org.eclipse.jface.preference.PreferencePage
      • checkSelectedElement

        protected abstract java.lang.String checkSelectedElement​(java.lang.Object element)
        Initializes the page for the selected object if it's of correct type and contents. If not, return an error message.
        element - The selected element (normally from the Common Navigator).
        Error message, or null for OK.
      • createContents

        protected org.eclipse.swt.widgets.Control createContents​(org.eclipse.swt.widgets.Composite parent)
        Specified by:
        createContents in class org.eclipse.jface.preference.PreferencePage
        See Also:
      • createContents

        protected abstract void createContents​(org.eclipse.swt.widgets.Composite composite,
                                               int parentWidth,
                                               int stdButtonWidth)
        The real creator must be overridden. The composite is created with no layout.
        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.
        false for failure, OK to keep on going.
      • performApply

        protected final void performApply()
        Performs apply. Cannot be overridden, saves settings if required.
        performApply in class org.eclipse.jface.preference.PreferencePage
      • performOk

        public final boolean performOk()
        Performs OK. Cannot be overridden, saves settings if required.
        Specified by:
        performOk in interface org.eclipse.jface.preference.IPreferencePage
        performOk in class org.eclipse.jface.preference.PreferencePage
      • 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.
        updateApplyButton in class org.eclipse.jface.preference.PreferencePage
      • setDefaultsEnabled

        protected void setDefaultsEnabled​(boolean on)
        Sets the Defaults button enabled state. If the Defaults button is not created, this method does nothing.