public abstract class TemplatePreferencePage extends PreferencePage implements IWorkbenchPreferencePage
Subclasses need to provide a TemplateStore and a
ContextTypeRegistry and should set the preference store. They may
optionally override isShowFormatterSetting().
ERROR, INFORMATION, NONE, WARNING| Modifier | Constructor and Description |
|---|---|
protected |
TemplatePreferencePage()
Creates a new template preference page.
|
| Modifier and Type | Method and Description |
|---|---|
protected Control |
createContents(Composite ancestor)
Creates and returns the SWT control for the customized body
of this preference page under the given parent composite.
|
protected Dialog |
createTemplateEditDialog(Template template,
boolean edit,
boolean isNameModifiable)
Deprecated.
not called any longer as of 3.1 - use
editTemplate(Template, boolean, boolean) |
protected SourceViewer |
createViewer(Composite parent)
Creates, configures and returns a source viewer to present the template
pattern on the preference page.
|
protected Template |
editTemplate(Template template,
boolean edit,
boolean isNameModifiable)
Creates the edit dialog.
|
ContextTypeRegistry |
getContextTypeRegistry()
Returns the context type registry.
|
protected String |
getFormatterPreferenceKey()
Returns the key to use for the formatter preference.
|
protected TableViewer |
getTableViewer() |
TemplateStore |
getTemplateStore()
Returns the template store.
|
protected SourceViewer |
getViewer() |
void |
init(IWorkbench workbench)
Initializes this preference page for the given workbench.
|
protected boolean |
isShowFormatterSetting()
Returns whether the formatter preference checkbox should be shown.
|
boolean |
performCancel()
The preference page implementation of an
IPreferencePage
method performs special processing when this page's Cancel button has
been pressed. |
protected void |
performDefaults()
Performs special processing when this page's Defaults button has been pressed.
|
boolean |
performOk()
Method declared on IPreferencePage.
|
void |
setContextTypeRegistry(ContextTypeRegistry registry)
Sets the context type registry.
|
void |
setTemplateStore(TemplateStore store)
Sets the template store.
|
void |
setVisible(boolean visible)
The
DialogPage implementation of this
IDialogPage method sets the control to the given
visibility state. |
protected void |
updateButtons()
Updates the buttons.
|
protected void |
updateViewerInput()
Updates the pattern viewer.
|
applyData, applyDialogFont, computeSize, contributeButtons, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButtonconvertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessageclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomputeSize, isValid, okToLeave, setContainer, setSizecreateControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitleprotected TemplatePreferencePage()
public TemplateStore getTemplateStore()
public ContextTypeRegistry getContextTypeRegistry()
public void setTemplateStore(TemplateStore store)
store - the new template storepublic void setContextTypeRegistry(ContextTypeRegistry registry)
registry - the new context type registrypublic void init(IWorkbench workbench)
IWorkbenchPreferencePageThis method is called automatically as the preference page is being created and initialized. Clients must not call this method.
init in interface IWorkbenchPreferencePageworkbench - the workbenchprotected Control createContents(Composite ancestor)
PreferencePage
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.
createContents in class PreferencePageancestor - the parent compositeprotected boolean isShowFormatterSetting()
true if the formatter preference checkbox should
be shown, false otherwiseprotected SourceViewer createViewer(Composite parent)
parent - the parent controlprotected void updateViewerInput()
protected void updateButtons()
protected Dialog createTemplateEditDialog(Template template, boolean edit, boolean isNameModifiable)
editTemplate(Template, boolean, boolean)template - the template being editededit - whether the dialog should be editableisNameModifiable - whether the template name may be modifiedEditTemplateDialog which will be opened.protected Template editTemplate(Template template, boolean edit, boolean isNameModifiable)
template - the template being editededit - whether the dialog should be editableisNameModifiable - whether the template name may be modifiednull if the edition failedpublic void setVisible(boolean visible)
DialogPageDialogPage implementation of this
IDialogPage method sets the control to the given
visibility state. Subclasses may extend.setVisible in interface IDialogPagesetVisible in class DialogPagevisible - true to make this page visible,
and false to hide itprotected void performDefaults()
PreferencePage
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.
performDefaults in class PreferencePagepublic boolean performOk()
PreferencePageperformOk in interface IPreferencePageperformOk in class PreferencePagefalse to abort the container's OK
processing and true to allow the OK to happenprotected String getFormatterPreferenceKey()
public boolean performCancel()
PreferencePageIPreferencePage
method performs special processing when this page's Cancel button has
been pressed.
This is a framework hook method for sublcasses to do special things when
the Cancel button has been pressed. The default implementation of this
framework method does nothing and returns true.
performCancel in interface IPreferencePageperformCancel in class PreferencePagefalse to abort the container's cancel
procedure and true to allow the cancel to happenprotected SourceViewer getViewer()
protected TableViewer getTableViewer()
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.