Eclipse Platform
Release 3.3

org.eclipse.ui.texteditor.templates
Class TemplatePreferencePage.EditTemplateDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended byorg.eclipse.jface.dialogs.TrayDialog
              extended byorg.eclipse.jface.dialogs.StatusDialog
                  extended byorg.eclipse.ui.texteditor.templates.TemplatePreferencePage.EditTemplateDialog
All Implemented Interfaces:
IShellProvider
Enclosing class:
TemplatePreferencePage

protected static class TemplatePreferencePage.EditTemplateDialog
extends StatusDialog

Dialog to edit a template. Clients will usually instantiate, but may also extend.

Since:
3.3

Nested Class Summary
 
Nested classes 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, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
TemplatePreferencePage.EditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry)
          Creates a new dialog.
 
Method Summary
 void create()
          Creates this window's widgetry in a new top-level shell.
protected  Control createDialogArea(Composite ancestor)
          Creates and returns the contents of the upper part of this dialog (above the button bar).
protected  SourceViewer createViewer(Composite parent)
          Creates the viewer to be used to display the pattern.
protected  IDialogSettings getDialogBoundsSettings()
          Gets the dialog settings that should be used for remembering the bounds of of the dialog, according to the dialog bounds strategy.
 Template getTemplate()
          Returns the created template.
protected  IContentAssistProcessor getTemplateProcessor()
          Returns the content assist processor that suggests template variables.
protected  void okPressed()
          Notifies 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, updateStatus
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
close, closeTray, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, 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, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplatePreferencePage.EditTemplateDialog

public TemplatePreferencePage.EditTemplateDialog(Shell parent,
                                                 Template template,
                                                 boolean edit,
                                                 boolean isNameModifiable,
                                                 ContextTypeRegistry registry)
Creates a new dialog.

Parameters:
parent - the shell parent of the dialog
template - the template to edit
edit - whether this is a new template or an existing being edited
isNameModifiable - whether the name of the template may be modified
registry - the context type registry to use
Method Detail

create

public void create()
Description copied from class: Window
Creates 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 calling createContents), then initializes this window's shell bounds (by calling initializeBounds).

Overrides:
create in class StatusDialog

createDialogArea

protected Control createDialogArea(Composite ancestor)
Description copied from class: Dialog
Creates and returns the contents of the upper part of this dialog (above the button bar).

The Dialog implementation of this framework method creates and returns a new Composite with 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 super as in the following example:

 Composite composite = (Composite) super.createDialogArea(parent);
 //add controls to composite as necessary
 return composite;
 

Overrides:
createDialogArea in class Dialog
Parameters:
ancestor - the parent composite to contain the dialog area
Returns:
the dialog area control

createViewer

protected SourceViewer createViewer(Composite parent)
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

okPressed

protected void okPressed()
Description copied from class: Dialog
Notifies that the ok button of this dialog has been pressed.

The Dialog implementation of this framework method sets this dialog's return code to Window.OK and closes the dialog. Subclasses may override.

Overrides:
okPressed in class Dialog

getTemplate

public Template getTemplate()
Returns the created template.

Returns:
the created template
Since:
3.1

getTemplateProcessor

protected IContentAssistProcessor getTemplateProcessor()
Returns the content assist processor that suggests template variables.

Returns:
the processor to suggest variables
Since:
3.3

getDialogBoundsSettings

protected IDialogSettings getDialogBoundsSettings()
Description copied from class: Dialog
Gets the dialog settings that should be used for remembering the bounds of of the dialog, according to the dialog bounds strategy.

Overrides:
getDialogBoundsSettings in class Dialog
Returns:
settings the dialog settings used to store the dialog's location and/or size, or null if the dialog's bounds should never be stored.
See Also:
Dialog.getDialogBoundsStrategy()

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.