Class TemplatePreferencePage.EditTemplateDialog
- All Implemented Interfaces:
IShellProvider
- Enclosing class:
TemplatePreferencePage
- Since:
- 3.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler -
Field Summary
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSISFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred -
Constructor Summary
ConstructorsConstructorDescriptionEditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry) Creates a new dialog. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates this window's widgetry in a new top-level shell.protected ControlcreateDialogArea(Composite ancestor) Creates and returns the contents of the upper part of this dialog (above the button bar).protected SourceViewercreateViewer(Composite parent) Creates the viewer to be used to display the pattern.protected IDialogSettingsGets the dialog settings that should be used for remembering the bounds of of the dialog, according to the dialog bounds strategy.Returns the created template.protected IContentAssistProcessorReturns the content assist processor that suggests template variables.protected booleanReturns a boolean indicating whether the dialog should be considered resizable when the shell style is initially set.protected booleanisValidPattern(String pattern) Validates the pattern.protected voidNotifies that the ok button of this dialog has been pressed.Methods inherited from class org.eclipse.jface.dialogs.StatusDialog
configureShell, createButtonBar, createButtonsForButtonBar, getStatus, setImage, setStatusLineAboveButtons, setTitle, updateButtonsEnableState, updateStatusMethods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailableMethods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
Constructor Details
-
EditTemplateDialog
public EditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry) Creates a new dialog.- Parameters:
parent- the shell parent of the dialogtemplate- the template to editedit- whether this is a new template or an existing being editedisNameModifiable- whether the name of the template may be modifiedregistry- the context type registry to use
-
-
Method Details
-
isResizable
protected boolean isResizable()Description copied from class:DialogReturns a boolean indicating whether the dialog should be considered resizable when the shell style is initially set.This method is used to ensure that all style bits appropriate for resizable dialogs are added to the shell style. Individual dialogs may always set the shell style to ensure that a dialog is resizable, but using this method ensures that resizable dialogs will be created with the same set of style bits.
Style bits will never be removed based on the return value of this method. For example, if a dialog returns
false, but also sets a style bit for a SWT.RESIZE border, the style bit will be honored.- Overrides:
isResizablein classDialog- Returns:
- a boolean indicating whether the dialog is resizable and should have the default style bits for resizable dialogs
-
create
public void create()Description copied from class:WindowCreates this window's widgetry in a new top-level shell.The default implementation of this framework method creates this window's shell (by calling
createShell), and its controls (by callingcreateContents), then initializes this window's shell bounds (by callinginitializeBounds).- Overrides:
createin classStatusDialog
-
createDialogArea
Description copied from class:DialogCreates and returns the contents of the upper part of this dialog (above the button bar).The
Dialogimplementation of this framework method creates and returns a newCompositewith standard margins and spacing.The returned control's layout data must be an instance of
GridData. This method must not modify the parent's layout.Subclasses must override this method but may call
superas in the following example:Composite composite = (Composite) super.createDialogArea(parent); //add controls to composite as necessary return composite;
- Overrides:
createDialogAreain classDialog- Parameters:
ancestor- the parent composite to contain the dialog area- Returns:
- the dialog area control
-
createViewer
Creates the viewer to be used to display the pattern. Subclasses may override.- Parameters:
parent- the parent composite of the viewer- Returns:
- a configured
SourceViewer
-
isValidPattern
Validates the pattern.The default implementation rejects invalid XML characters.
- Parameters:
pattern- the pattern to verify- Returns:
trueif the pattern is valid- Since:
- 3.7 protected, before it was private
-
okPressed
protected void okPressed()Description copied from class:DialogNotifies that the ok button of this dialog has been pressed.The
Dialogimplementation of this framework method sets this dialog's return code toWindow.OKand closes the dialog. Subclasses may override. -
getTemplate
Returns the created template.- Returns:
- the created template
- Since:
- 3.1
-
getTemplateProcessor
Returns the content assist processor that suggests template variables.- Returns:
- the processor to suggest variables
- Since:
- 3.3
-
getDialogBoundsSettings
Description copied from class:DialogGets the dialog settings that should be used for remembering the bounds of of the dialog, according to the dialog bounds strategy.- Overrides:
getDialogBoundsSettingsin classDialog- Returns:
- settings the dialog settings used to store the dialog's location
and/or size, or
nullif the dialog's bounds should never be stored. - See Also:
-