Class TemplatePreferencePage.EditTemplateDialog

All Implemented Interfaces:
Enclosing class:

protected static class TemplatePreferencePage.EditTemplateDialog extends StatusDialog
Dialog to edit a template. Clients will usually instantiate, but may also extend.
  • Constructor Details

    • EditTemplateDialog

      public EditTemplateDialog(Shell parent, Template template, boolean edit, boolean isNameModifiable, ContextTypeRegistry registry)
      Creates a new dialog.
      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 Details

    • isResizable

      protected boolean isResizable()
      Description copied from class: Dialog
      Returns 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.

      isResizable in class Dialog
      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: 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).

      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;
      createDialogArea in class Dialog
      ancestor - the parent composite to contain the dialog area
      the dialog area control
    • createViewer

      protected SourceViewer createViewer(Composite parent)
      Creates the viewer to be used to display the pattern. Subclasses may override.
      parent - the parent composite of the viewer
      a configured SourceViewer
    • isValidPattern

      protected boolean isValidPattern(String pattern)
      Validates the pattern.

      The default implementation rejects invalid XML characters.

      pattern - the pattern to verify
      true if the pattern is valid
      3.7 protected, before it was private
    • 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.

      okPressed in class Dialog
    • getTemplate

      public Template getTemplate()
      Returns the created template.
      the created template
    • getTemplateProcessor

      protected IContentAssistProcessor getTemplateProcessor()
      Returns the content assist processor that suggests template variables.
      the processor to suggest variables
    • 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.
      getDialogBoundsSettings in class Dialog
      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: