|
Eclipse Platform Release 3.1 |
|||||||||||
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
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()
Notifies that the container of this preference page has been canceled. |
protected void |
performDefaults()
Performs special processing when this page's Defaults button has been pressed. |
boolean |
performOk()
Notifies that the OK button of this page's container has been pressed. |
void |
setContextTypeRegistry(ContextTypeRegistry registry)
Sets the context type registry. |
void |
setTemplateStore(TemplateStore store)
Sets the template store. |
void |
setVisible(boolean visible)
Sets the visibility of this dialog page. |
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)
IWorkbenchPreferencePage
This method is called automatically as the preference page is being created and initialized. Clients must not call this method.
init
in interface IWorkbenchPreferencePage
workbench
- 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 PreferencePage
ancestor
- 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)
IDialogPage
setVisible
in interface IDialogPage
setVisible
in class DialogPage
protected 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 PreferencePage
public boolean performOk()
IPreferencePage
performOk
in interface IPreferencePage
performOk
in class PreferencePage
protected String getFormatterPreferenceKey()
public boolean performCancel()
IPreferencePage
performCancel
in interface IPreferencePage
performCancel
in class PreferencePage
protected SourceViewer getViewer()
protected TableViewer getTableViewer()
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.