|
Eclipse Platform Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
org.eclipse.ui.texteditor.templates.TemplatePreferencePage
public abstract class TemplatePreferencePage
A template preference page allows configuration of the templates for an editor. It provides controls for adding, removing and changing templates as well as enablement, default management and an optional formatter preference.
Subclasses need to provide a TemplateStore and a
ContextTypeRegistry and should set the preference store. They may
optionally override isShowFormatterSetting().
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider |
|---|
ERROR, INFORMATION, NONE, WARNING |
| Constructor Summary | |
|---|---|
protected |
TemplatePreferencePage()
Creates a new template preference page. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.eclipse.jface.preference.PreferencePage |
|---|
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, 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 |
|---|
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle |
| Constructor Detail |
|---|
protected TemplatePreferencePage()
| Method Detail |
|---|
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 composite
protected boolean isShowFormatterSetting()
true if the formatter preference checkbox should
be shown, false otherwiseprotected SourceViewer createViewer(Composite parent)
parent - the parent control
protected 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 modified
EditTemplateDialog 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 modified
null 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()
PreferencePage
performOk 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()
|
Eclipse Platform Release 3.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.