Class ModifyDialogTabPage

java.lang.Object
org.eclipse.m2m.atl.adt.ui.preferences.ModifyDialogTabPage
All Implemented Interfaces:
IModifyDialogTabPage
Direct Known Subclasses:
AtlCodeFormatterProfilesTabPage, AtlCodeFormatterPropertiesTabPage

public abstract class ModifyDialogTabPage extends Object implements IModifyDialogTabPage
  • Field Details

    • fShowInvisibleButton

      protected org.eclipse.swt.widgets.Button fShowInvisibleButton
    • fUpdater

      protected final Observer fUpdater
      This is the default listener for any of the Preference classes. It is added by the respective factory methods and updates the page's preview on each change.
    • fDefaultFocusManager

      protected final ModifyDialogTabPage.DefaultFocusManager fDefaultFocusManager
      The default focus manager. This widget knows all widgets which can have the focus and listens for focusGained events, on which it stores the index of the current focus holder. When the dialog is restarted, restoreFocus() sets the focus to the last control which had it. The standard Preference object are managed by this focus manager if they are created using the respective factory methods. Other SWT widgets can be added in subclasses when they are created.
    • fPixelConverter

      protected org.eclipse.jface.layout.PixelConverter fPixelConverter
      A pixel converter for layout calculations
    • fWorkingValues

      protected Map<String,String> fWorkingValues
      The map where the current settings are stored.
  • Constructor Details

  • Method Details

    • setWorkingValues

      public void setWorkingValues(Map<String,String> workingValues)
      A map containing key value pairs this tab page is must modify.
      Specified by:
      setWorkingValues in interface IModifyDialogTabPage
      Parameters:
      workingValues - the values to work with
    • setModifyListener

      public void setModifyListener(IModifyDialogTabPage.IModificationListener modifyListener)
      A modify listener which must be informed whenever a value in the map passed to IModifyDialogTabPage.setWorkingValues(Map) changes. The listener can also be informed about status changes.
      Specified by:
      setModifyListener in interface IModifyDialogTabPage
      Parameters:
      modifyListener - the listener to inform
    • createContents

      public org.eclipse.swt.widgets.Composite createContents(org.eclipse.swt.widgets.Composite parent)
      Create the contents of this tab page.

      Subclasses should implement doCreatePreferences and doCreatePreview may also be overridden as necessary.

      Specified by:
      createContents in interface IModifyDialogTabPage
      Parameters:
      parent - The parent composite
      Returns:
      Created content control
    • initializePage

      protected abstract void initializePage()
      This method is called after all controls have been allocated, including the preview. It can be used to set the preview text and to create listeners.
    • doCreatePreferences

      protected abstract void doCreatePreferences(org.eclipse.swt.widgets.Composite composite, int numColumns)
      Create the left side of the modify dialog. This is meant to be implemented by subclasses.
      Parameters:
      composite - Composite to create in
      numColumns - Number of columns to use
    • doCreatePreviewPane

      protected org.eclipse.swt.widgets.Composite doCreatePreviewPane(org.eclipse.swt.widgets.Composite composite, int numColumns)
      Create the right side of the modify dialog. By default, the preview is displayed there. Subclasses can override this method in order to customize the right-hand side of the dialog.
      Parameters:
      composite - Composite to create in
      numColumns - Number of columns to use
      Returns:
      Created composite
    • doCreateAtlPreview

      protected abstract AtlPreview doCreateAtlPreview(org.eclipse.swt.widgets.Composite parent)
      To be implemented by subclasses. This method should return an instance of JavaPreview. Currently, the choice is between CompilationUnitPreview which contains a valid compilation unit, or a SnippetPreview which formats several independent code snippets and displays them in the same window.
      Parameters:
      parent - Parent composite
      Returns:
      Created preview
    • makeVisible

      public final void makeVisible()
      This is called when the page becomes visible. Common tasks to do include:
      • Updating the preview.
      • Setting the focus
      Specified by:
      makeVisible in interface IModifyDialogTabPage
    • doUpdatePreview

      protected abstract void doUpdatePreview()
      Update the preview. To be implemented by subclasses.
    • notifyValuesModified

      protected void notifyValuesModified()
    • setInitialFocus

      public void setInitialFocus()
      Each tab page should remember where its last focus was, and reset it correctly within this method. This method is only called after initialization on the first tab page to be displayed in order to restore the focus of the last session.
      Specified by:
      setInitialFocus in interface IModifyDialogTabPage
    • updateStatus

      protected void updateStatus(org.eclipse.core.runtime.IStatus status)
      Set the status field on the dialog. This can be used by tab pages to report inconsistent input. The OK button is disabled if the kind is IStatus.ERROR.
      Parameters:
      status - Status describing the current page error state
    • createGridLayout

      protected org.eclipse.swt.layout.GridLayout createGridLayout(int numColumns, boolean margins)
    • createGridData

      protected static org.eclipse.swt.layout.GridData createGridData(int numColumns, int style, int widthHint)
    • createLabel

      protected static org.eclipse.swt.widgets.Label createLabel(int numColumns, org.eclipse.swt.widgets.Composite parent, String text)
    • createLabel

      protected static org.eclipse.swt.widgets.Label createLabel(int numColumns, org.eclipse.swt.widgets.Composite parent, String text, int gridDataStyle)
    • createGroup

      protected org.eclipse.swt.widgets.Group createGroup(int numColumns, org.eclipse.swt.widgets.Composite parent, String text)
    • createNumberPref

      protected ModifyDialogTabPage.NumberPreference createNumberPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, int minValue, int maxValue)
    • createStringPref

      protected ModifyDialogTabPage.StringPreference createStringPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, org.eclipse.jface.dialogs.IInputValidator inputValidator)
    • createComboPref

      protected ModifyDialogTabPage.ComboPreference createComboPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values, String[] items)
    • createCheckboxPref

      protected ModifyDialogTabPage.CheckboxPreference createCheckboxPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values)
    • createRadioPref

      protected ModifyDialogTabPage.RadioPreference createRadioPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values)
    • setPreview

      public void setPreview(AtlPreview fPreview)
    • getPreview

      public AtlPreview getPreview()
    • getShowInvisibleButton

      public org.eclipse.swt.widgets.Button getShowInvisibleButton()
    • updateTab

      public abstract void updateTab(boolean enabled)