org.eclipse.xtext.builder.preferences
Class PropertyAndPreferencePage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.xtext.builder.preferences.PropertyAndPreferencePage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPreferencePage, org.eclipse.ui.IWorkbenchPropertyPage
Direct Known Subclasses:
BuilderPreferencePage

public abstract class PropertyAndPreferencePage
extends org.eclipse.jface.preference.PreferencePage
implements org.eclipse.ui.IWorkbenchPreferencePage, org.eclipse.ui.IWorkbenchPropertyPage

Initially copied from Jdt.

Since:
2.1
Author:
Michael Clay

Field Summary
static java.lang.String DATA_NO_LINK
           
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
PropertyAndPreferencePage()
           
 
Method Summary
 void applyData(java.lang.Object data)
          Applies the given data to this page.
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
          Creates and returns the SWT control for the customized body of this preference page under the given parent composite.
protected  org.eclipse.swt.widgets.Label createDescriptionLabel(org.eclipse.swt.widgets.Composite parent)
          Creates and returns an SWT label under the given composite.
protected abstract  org.eclipse.swt.widgets.Control createPreferenceContent(org.eclipse.swt.widgets.Composite composite, org.eclipse.jface.preference.IPreferencePageContainer preferencePageContainer)
           
protected  void doStatusChanged()
           
protected  void enablePreferenceContent(boolean enable)
           
protected  void enableProjectSpecificSettings(boolean useProjectSpecificSettings)
           
protected  java.util.Map<java.lang.Object,java.lang.Object> getData()
           
 org.eclipse.core.runtime.IAdaptable getElement()
          Returns the object that owns the properties shown in this page.
protected  IStatusChangeListener getNewStatusChangedListener()
           
protected  org.eclipse.core.runtime.IStatus getPreferenceContentStatus()
           
protected abstract  java.lang.String getPreferencePageID()
           
protected  org.eclipse.core.resources.IProject getProject()
           
protected abstract  java.lang.String getPropertyPageID()
           
protected  org.eclipse.ui.preferences.IWorkingCopyManager getWorkingCopyManager()
           
protected abstract  boolean hasProjectSpecificOptions(org.eclipse.core.resources.IProject project)
           
 void init(org.eclipse.ui.IWorkbench workbench)
          Initializes this preference page for the given workbench.
protected  boolean isProjectPreferencePage()
           
protected  boolean offerLink()
           
protected  void openProjectProperties(org.eclipse.core.resources.IProject project, java.lang.Object data)
           
protected  void openWorkspacePreferences(java.lang.Object data)
           
protected  void performDefaults()
          Performs special processing when this page's Defaults button has been pressed.
 void setElement(org.eclipse.core.runtime.IAdaptable element)
          Sets the object that owns the properties shown in this page.
protected  void setPreferenceContentStatus(org.eclipse.core.runtime.IStatus status)
           
protected  boolean supportsProjectSpecificOptions()
           
protected  boolean useProjectSettings()
           
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyDialogFont, computeSize, contributeButtons, createControl, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, performOk, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
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.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, performOk, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Field Detail

DATA_NO_LINK

public static final java.lang.String DATA_NO_LINK
See Also:
Constant Field Values
Constructor Detail

PropertyAndPreferencePage

public PropertyAndPreferencePage()
Method Detail

createPreferenceContent

protected abstract org.eclipse.swt.widgets.Control createPreferenceContent(org.eclipse.swt.widgets.Composite composite,
                                                                           org.eclipse.jface.preference.IPreferencePageContainer preferencePageContainer)

hasProjectSpecificOptions

protected abstract boolean hasProjectSpecificOptions(org.eclipse.core.resources.IProject project)

getPreferencePageID

protected abstract java.lang.String getPreferencePageID()

getPropertyPageID

protected abstract java.lang.String getPropertyPageID()

supportsProjectSpecificOptions

protected boolean supportsProjectSpecificOptions()

offerLink

protected boolean offerLink()

createDescriptionLabel

protected org.eclipse.swt.widgets.Label createDescriptionLabel(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.preference.PreferencePage
Creates and returns an SWT label under the given composite.

Overrides:
createDescriptionLabel in class org.eclipse.jface.preference.PreferencePage
Parameters:
parent - the parent composite
Returns:
the new label

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
Description copied from class: org.eclipse.jface.preference.PreferencePage
Creates 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 Composite object whose Layout has default margins (for example, a GridLayout) are expected to set the margins of this Layout to 0 pixels.

Specified by:
createContents in class org.eclipse.jface.preference.PreferencePage
Parameters:
parent - the parent composite
Returns:
the new control

useProjectSettings

protected boolean useProjectSettings()

isProjectPreferencePage

protected boolean isProjectPreferencePage()

getProject

protected org.eclipse.core.resources.IProject getProject()

openWorkspacePreferences

protected final void openWorkspacePreferences(java.lang.Object data)

openProjectProperties

protected final void openProjectProperties(org.eclipse.core.resources.IProject project,
                                           java.lang.Object data)

enableProjectSpecificSettings

protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings)

setPreferenceContentStatus

protected void setPreferenceContentStatus(org.eclipse.core.runtime.IStatus status)

getNewStatusChangedListener

protected IStatusChangeListener getNewStatusChangedListener()

getPreferenceContentStatus

protected org.eclipse.core.runtime.IStatus getPreferenceContentStatus()

doStatusChanged

protected void doStatusChanged()

enablePreferenceContent

protected void enablePreferenceContent(boolean enable)

performDefaults

protected void performDefaults()
Description copied from class: org.eclipse.jface.preference.PreferencePage
Performs special processing when this page's Defaults button has been pressed.

This is a framework hook method for subclasses to do special things when the Defaults button has been pressed. Subclasses may override, but should call super.performDefaults.

Overrides:
performDefaults in class org.eclipse.jface.preference.PreferencePage

init

public void init(org.eclipse.ui.IWorkbench workbench)
Description copied from interface: org.eclipse.ui.IWorkbenchPreferencePage
Initializes this preference page for the given workbench.

This method is called automatically as the preference page is being created and initialized. Clients must not call this method.

Specified by:
init in interface org.eclipse.ui.IWorkbenchPreferencePage
Parameters:
workbench - the workbench

getElement

public org.eclipse.core.runtime.IAdaptable getElement()
Description copied from interface: org.eclipse.ui.IWorkbenchPropertyPage
Returns the object that owns the properties shown in this page.

Specified by:
getElement in interface org.eclipse.ui.IWorkbenchPropertyPage
Returns:
the object that owns the properties shown in this page

setElement

public void setElement(org.eclipse.core.runtime.IAdaptable element)
Description copied from interface: org.eclipse.ui.IWorkbenchPropertyPage
Sets the object that owns the properties shown in this page. The page is expected to store this object and provide it if getElement is called.

As of Eclipse 3.2 the org.eclipse.ui.propertyPages extension point now supports non IAdaptable inputs. An input that is not an IAdaptable will be wrapped in an IAdaptable by the workbench before it is forwarded to this method.

Specified by:
setElement in interface org.eclipse.ui.IWorkbenchPropertyPage
Parameters:
element - the object that owns the properties shown in this page
See Also:
PropertyDialogAction

applyData

public void applyData(java.lang.Object data)
Description copied from class: org.eclipse.jface.preference.PreferencePage
Applies the given data to this page.

It is up to the subclasses to specify the contract and the data format. The contract is not guaranteed if the subclass is in an internal package.

Note: The implementation must silently ignore all unknown data.

The default implementation does nothing.

Overrides:
applyData in class org.eclipse.jface.preference.PreferencePage
Parameters:
data - the data as specified by the subclass

getData

protected java.util.Map<java.lang.Object,java.lang.Object> getData()

getWorkingCopyManager

protected org.eclipse.ui.preferences.IWorkingCopyManager getWorkingCopyManager()