Package org.eclipse.m2m.atl.adt.ui.preferences

# 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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`ModifyDialogTabPage.ButtonPreference`
Wrapper around a checkbox and a label.
`protected final class`
`ModifyDialogTabPage.CheckboxPreference`
`protected final class`
`ModifyDialogTabPage.ComboPreference`
Wrapper around a Combo box.
`protected static final class`
`ModifyDialogTabPage.DefaultFocusManager`
This class provides the default way to preserve and re-establish the focus over multiple modify sessions.
`protected final class`
`ModifyDialogTabPage.NumberPreference`
Wrapper around a textfied which requests an integer input of a given range.
`protected class`
`ModifyDialogTabPage.Preference`
The base class of all Preference classes.
`protected final class`
`ModifyDialogTabPage.RadioPreference`
`protected final class`
`ModifyDialogTabPage.StringPreference`
Wrapper around a text field which requests a string input.

## Nested classes/interfaces inherited from interface org.eclipse.m2m.atl.adt.ui.preferences.IModifyDialogTabPage

`IModifyDialogTabPage.IModificationListener`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final ModifyDialogTabPage.DefaultFocusManager`
`fDefaultFocusManager`
The default focus manager.
`protected org.eclipse.jface.layout.PixelConverter`
`fPixelConverter`
A pixel converter for layout calculations
`protected org.eclipse.swt.widgets.Button`
`fShowInvisibleButton`
`protected final Observer`
`fUpdater`
This is the default listener for any of the Preference classes.
`protected Map<String,String>`
`fWorkingValues`
The map where the current settings are stored.

## Constructor Summary

Constructors
Constructor
Description
`ModifyDialogTabPage()`
`ModifyDialogTabPage(IModifyDialogTabPage.IModificationListener modifyListener, Map<String,String> workingValues)`

## Method Summary

Modifier and Type
Method
Description
`protected ModifyDialogTabPage.CheckboxPreference`
`createCheckboxPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values)`
`protected ModifyDialogTabPage.ComboPreference`
`createComboPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values, String[] items)`
`org.eclipse.swt.widgets.Composite`
`createContents(org.eclipse.swt.widgets.Composite parent)`
Create the contents of this tab page.
`protected static org.eclipse.swt.layout.GridData`
`createGridData(int numColumns, int style, int widthHint)`
`protected org.eclipse.swt.layout.GridLayout`
`createGridLayout(int numColumns, boolean margins)`
`protected org.eclipse.swt.widgets.Group`
`createGroup(int numColumns, org.eclipse.swt.widgets.Composite parent, String text)`
`protected static org.eclipse.swt.widgets.Label`
`createLabel(int numColumns, org.eclipse.swt.widgets.Composite parent, String text)`
`protected static org.eclipse.swt.widgets.Label`
`createLabel(int numColumns, org.eclipse.swt.widgets.Composite parent, String text, int gridDataStyle)`
`protected ModifyDialogTabPage.NumberPreference`
`createNumberPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, int minValue, int maxValue)`
`protected ModifyDialogTabPage.RadioPreference`
`createRadioPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, String[] values)`
`protected ModifyDialogTabPage.StringPreference`
`createStringPref(org.eclipse.swt.widgets.Composite composite, int numColumns, String name, String key, org.eclipse.jface.dialogs.IInputValidator inputValidator)`
`protected abstract AtlPreview`
`doCreateAtlPreview(org.eclipse.swt.widgets.Composite parent)`
To be implemented by subclasses.
`protected abstract void`
`doCreatePreferences(org.eclipse.swt.widgets.Composite composite, int numColumns)`
Create the left side of the modify dialog.
`protected org.eclipse.swt.widgets.Composite`
`doCreatePreviewPane(org.eclipse.swt.widgets.Composite composite, int numColumns)`
Create the right side of the modify dialog.
`protected abstract void`
`doUpdatePreview()`
Update the preview.
`AtlPreview`
`getPreview()`
`org.eclipse.swt.widgets.Button`
`getShowInvisibleButton()`
`protected abstract void`
`initializePage()`
This method is called after all controls have been allocated, including the preview.
`final void`
`makeVisible()`
This is called when the page becomes visible.
`protected void`
`notifyValuesModified()`
`void`
`setInitialFocus()`
Each tab page should remember where its last focus was, and reset it correctly within this method.
`void`
`setModifyListener(IModifyDialogTabPage.IModificationListener modifyListener)`
A modify listener which must be informed whenever a value in the map passed to `IModifyDialogTabPage.setWorkingValues(Map)` changes.
`void`
`setPreview(AtlPreview fPreview)`
`void`
`setWorkingValues(Map<String,String> workingValues)`
A map containing key value pairs this tab page is must modify.
`protected void`
`updateStatus(org.eclipse.core.runtime.IStatus status)`
Set the status field on the dialog.
`abstract void`
`updateTab(boolean enabled)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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

### ModifyDialogTabPage

public ModifyDialogTabPage(IModifyDialogTabPage.IModificationListener modifyListener, Map<String,String> workingValues)

### ModifyDialogTabPage

public ModifyDialogTabPage()

## 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)