org.eclipse.xtext.ui.editor.preferences.fields
Class AbstractDetailsPart

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.jface.preference.FieldEditorPreferencePage
              extended by org.eclipse.xtext.ui.editor.preferences.fields.AbstractDetailsPart
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.jface.util.IPropertyChangeListener
Direct Known Subclasses:
TokenTypeDefDetailsPart

public abstract class AbstractDetailsPart
extends org.eclipse.jface.preference.FieldEditorPreferencePage

Author:
Dennis Hübner - Initial contribution and API

Field Summary
protected  org.eclipse.jface.preference.PreferenceStore internalStore
           
protected  org.eclipse.jface.preference.IPreferenceStore masterPreferenceStore
           
 
Fields inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
FLAT, GRID, MARGIN_HEIGHT, MARGIN_WIDTH, VERTICAL_SPACING
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
AbstractDetailsPart(org.eclipse.jface.preference.IPreferenceStore masterPreferenceStore)
           
 
Method Summary
protected  void addField(org.eclipse.jface.preference.FieldEditor editor)
          Adds the given field editor to this page.
 void createControl(org.eclipse.swt.widgets.Composite parent)
          The PreferencePage implementation of this IDialogPage method creates a description label and button bar for the page.
protected abstract  void createFieldEditors()
          Creates the page's field editors.
protected  org.eclipse.jface.preference.IPreferenceStore doGetPreferenceStore()
          Returns the preference store of this preference page.
protected  java.lang.String getPreferencePrefix()
           
protected  void load(java.lang.String preferencePrefix)
           
protected  void loadDefaults(java.lang.String preferencePrefix)
           
 boolean performOk()
          The field editor preference page implementation of this PreferencePage method saves all field editors by calling FieldEditor.store.
 void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
          The field editor preference page implementation of this IPreferencePage (and IPropertyChangeListener) method intercepts IS_VALID events but passes other events on to its superclass.
 
Methods inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
adjustGridLayout, applyFont, checkState, createContents, dispose, getFieldEditorParent, initialize, performDefaults, setVisible
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods 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, setMessage
 
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
getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, setDescription, setImageDescriptor
 

Field Detail

masterPreferenceStore

protected org.eclipse.jface.preference.IPreferenceStore masterPreferenceStore

internalStore

protected org.eclipse.jface.preference.PreferenceStore internalStore
Constructor Detail

AbstractDetailsPart

public AbstractDetailsPart(org.eclipse.jface.preference.IPreferenceStore masterPreferenceStore)
Method Detail

addField

protected final void addField(org.eclipse.jface.preference.FieldEditor editor)
Description copied from class: org.eclipse.jface.preference.FieldEditorPreferencePage
Adds the given field editor to this page.

Overrides:
addField in class org.eclipse.jface.preference.FieldEditorPreferencePage
Parameters:
editor - the field editor

doGetPreferenceStore

protected final org.eclipse.jface.preference.IPreferenceStore doGetPreferenceStore()
Description copied from class: org.eclipse.jface.preference.PreferencePage
Returns the preference store of this preference page.

This is a framework hook method for subclasses to return a page-specific preference store. The default implementation returns null.

Overrides:
doGetPreferenceStore in class org.eclipse.jface.preference.PreferencePage
Returns:
the preference store, or null if none

load

protected final void load(java.lang.String preferencePrefix)

loadDefaults

protected final void loadDefaults(java.lang.String preferencePrefix)

performOk

public final boolean performOk()
Description copied from class: org.eclipse.jface.preference.FieldEditorPreferencePage
The field editor preference page implementation of this PreferencePage method saves all field editors by calling FieldEditor.store. Note that this method does not save the preference store itself; it just stores the values back into the preference store.

Specified by:
performOk in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performOk in class org.eclipse.jface.preference.FieldEditorPreferencePage
Returns:
false to abort the container's OK processing and true to allow the OK to happen
See Also:
FieldEditor.store()

createControl

public final void createControl(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.preference.PreferencePage
The PreferencePage implementation of this IDialogPage method creates a description label and button bar for the page. It calls createContents to create the custom contents of the page.

If a subclass that overrides this method creates a Composite that has a layout with default margins (for example, a GridLayout) it is expected to set the margins of this Layout to 0 pixels.

Specified by:
createControl in interface org.eclipse.jface.dialogs.IDialogPage
Overrides:
createControl in class org.eclipse.jface.preference.PreferencePage
Parameters:
parent - the parent composite
See Also:
IDialogPage.createControl(Composite)

propertyChange

public final void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
Description copied from class: org.eclipse.jface.preference.FieldEditorPreferencePage
The field editor preference page implementation of this IPreferencePage (and IPropertyChangeListener) method intercepts IS_VALID events but passes other events on to its superclass.

Specified by:
propertyChange in interface org.eclipse.jface.util.IPropertyChangeListener
Overrides:
propertyChange in class org.eclipse.jface.preference.FieldEditorPreferencePage
Parameters:
event - the property change event object describing which property changed and how

createFieldEditors

protected abstract void createFieldEditors()
Description copied from class: org.eclipse.jface.preference.FieldEditorPreferencePage
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 getFieldEditorParent to 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

Specified by:
createFieldEditors in class org.eclipse.jface.preference.FieldEditorPreferencePage

getPreferencePrefix

protected final java.lang.String getPreferencePrefix()