org.eclipse.xtext.ui.editor.templates
Class XtextTemplatePreferencePage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.ui.texteditor.templates.TemplatePreferencePage
              extended by org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.ui.IWorkbenchPreferencePage
Direct Known Subclasses:
AdvancedTemplatesPreferencePage

public class XtextTemplatePreferencePage
extends org.eclipse.ui.texteditor.templates.TemplatePreferencePage

Author:
Sven Efftinge - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ui.texteditor.templates.TemplatePreferencePage
org.eclipse.ui.texteditor.templates.TemplatePreferencePage.EditTemplateDialog
 
Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
XtextTemplatePreferencePage(org.eclipse.jface.preference.IPreferenceStore preferenceStore, org.eclipse.jface.text.templates.ContextTypeRegistry registry, org.eclipse.jface.text.templates.persistence.TemplateStore templateStore)
           
 
Method Summary
protected  org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite ancestor)
          Creates and returns the SWT control for the customized body of this preference page under the given parent composite.
 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  boolean isShowFormatterSetting()
          Returns whether the formatter preference checkbox should be shown.
 
Methods inherited from class org.eclipse.ui.texteditor.templates.TemplatePreferencePage
createTemplateEditDialog, createViewer, editTemplate, getContextTypeRegistry, getFormatterPreferenceKey, getTableViewer, getTemplateStore, getViewer, init, performCancel, performDefaults, performOk, setContextTypeRegistry, setTemplateStore, setVisible, updateButtons, updateViewerInput
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performHelp, 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
 
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, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle
 

Constructor Detail

XtextTemplatePreferencePage

@Inject
public XtextTemplatePreferencePage(org.eclipse.jface.preference.IPreferenceStore preferenceStore,
                                          org.eclipse.jface.text.templates.ContextTypeRegistry registry,
                                          org.eclipse.jface.text.templates.persistence.TemplateStore templateStore)
Method Detail

isShowFormatterSetting

protected boolean isShowFormatterSetting()
Description copied from class: org.eclipse.ui.texteditor.templates.TemplatePreferencePage
Returns whether the formatter preference checkbox should be shown.

Overrides:
isShowFormatterSetting in class org.eclipse.ui.texteditor.templates.TemplatePreferencePage
Returns:
true if the formatter preference checkbox should be shown, false otherwise

createContents

protected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite ancestor)
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.

Overrides:
createContents in class org.eclipse.ui.texteditor.templates.TemplatePreferencePage
Parameters:
ancestor - the parent composite
Returns:
the new control

createControl

public 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)