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

# Class AbstractPropertyAndPreferencePage

java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
org.eclipse.ui.dialogs.PropertyPage
org.eclipse.m2m.atl.adt.ui.preferences.AbstractPropertyAndPreferencePage

All Implemented Interfaces:
  `org.eclipse.jface.dialogs.IDialogPage`, `org.eclipse.jface.dialogs.IMessageProvider`, `org.eclipse.jface.preference.IPreferencePage`, `org.eclipse.ui.IWorkbenchPreferencePage`, `org.eclipse.ui.IWorkbenchPropertyPage`

Direct Known Subclasses:
  `AtlCodeAssistPreferencePage`, `AtlCodeFormatterPropertyPage`, `AtlEditorPreferencePage`, `AtlEditorPropertyPage`, `AtlMainPreferencePage`, `AtlMainPropertyPage`, `AtlSyntaxPreferencePage`, `AtlTypingPreferencePage`

public abstract class AbstractPropertyAndPreferencePage extends org.eclipse.ui.dialogs.PropertyPage implements org.eclipse.ui.IWorkbenchPropertyPage, org.eclipse.ui.IWorkbenchPreferencePage
This abstract class permits other properties pages to use some classical method such creating fields openly used.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String[][]`
`checkBoxModel`
`protected org.eclipse.swt.widgets.List`
`colorList`
`protected String[][]`
`colorListModel`
`protected org.eclipse.jface.preference.ColorSelector`
`colorSelector`
`protected AtlPreferenceStore`
`fPreferenceeStore`
`protected AtlPreview`
`preview`
`protected String[][]`
`properties`
`protected Map<org.eclipse.swt.widgets.TableItem,String>`
`tableProperties`
`protected String[][]`
`textFieldModel`

### Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider

`ERROR, INFORMATION, NONE, WARNING`

## Constructor Summary

Constructors
Constructor
Description
`AbstractPropertyAndPreferencePage(String title)`
Creates a new preference page with a title using the `PreferencePage` constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
`protected org.eclipse.jface.preference.IPreferenceStore`
`doGetPreferenceStore()`
`org.eclipse.jface.preference.IPreferenceStore`
`getPreferenceStore()`
`protected void`
`handleColorListSelection()`
When a selection is made, the color button handles the color sets by this selection.
`void`
`init(org.eclipse.ui.IWorkbench workbench)`
`protected void`
`initialize()`
Initializes the preference page with the user values.
`protected void`
`initializeFieldsToDefaultValues()`
Initializes the preference page widgets with the default values.
`protected void`
`initializeFieldsToUserValues()`
Initializes the preference page widgets with the user values.
`protected org.eclipse.swt.widgets.Button`
`newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label)`
Creates an new checkbox instance.
`protected org.eclipse.swt.widgets.Button`
`newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label, String key)`
Creates an new checkbox instance and stores it in a hash map.
`protected org.eclipse.swt.widgets.Button`
`newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label, String key, org.eclipse.swt.events.SelectionListener sl)`
Creates an new checkbox instance and stores it in a hash map.
`protected org.eclipse.swt.widgets.Control[]`
`newColorList(org.eclipse.swt.widgets.Composite parent, String listLabel, String buttonLabel, String[][] colorListModel)`
Creates a new color list with a label and a color selector button.
`protected org.eclipse.swt.widgets.Composite`
`newComposite(org.eclipse.swt.widgets.Composite parent, int numColumns)`
Creates composite control and sets the default layout data.
`protected org.eclipse.swt.widgets.Composite`
`newCompositeCheckBoxes(org.eclipse.swt.widgets.Composite parent)`
`protected org.eclipse.swt.widgets.Composite`
`newCompositeColors(org.eclipse.swt.widgets.Composite parent, String listLabel, String buttonLabel)`
`protected org.eclipse.swt.widgets.Composite`
`newCompositeTextFields(org.eclipse.swt.widgets.Composite parent)`
`protected org.eclipse.swt.widgets.Group`
`newGroup(org.eclipse.swt.widgets.Composite parent, String text)`
Creates a new elements group with a title above the side.
`protected org.eclipse.swt.widgets.Label`
`newLabelField(org.eclipse.swt.widgets.Composite parent, String text)`
Utility method that creates a label instance and sets the default layout data.
`protected org.eclipse.swt.widgets.Text`
`newLabelledTextField(org.eclipse.swt.widgets.Composite parent, String label, String text, int limit, String key)`
Creates a new group composed by a label and an editable text field.
`protected org.eclipse.swt.widgets.Button`
`newPushButton(org.eclipse.swt.widgets.Composite parent, String text, org.eclipse.swt.events.SelectionListener sl)`
Utility method that creates a push button instance and sets the default layout data.
`protected org.eclipse.swt.widgets.Button`
`newRadioButton(org.eclipse.swt.widgets.Composite parent, String text, org.eclipse.swt.events.SelectionListener sl)`
Utility method that creates a radio button instance and sets the default layout data.
`protected org.eclipse.swt.widgets.List`
`newScrollList(org.eclipse.swt.widgets.Composite parent)`
Creates a new scroll list.
`protected org.eclipse.swt.widgets.TabItem`
`newTabItem(org.eclipse.swt.widgets.TabFolder parent, String text, org.eclipse.swt.widgets.Control control)`
Creates a new tab item in a tab folder.
`protected org.eclipse.swt.widgets.Text`
`newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit)`
Creates a new editable text field.
`protected org.eclipse.swt.widgets.Text`
`newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit, String key)`
Creates a new editable text field.
`protected org.eclipse.swt.widgets.Text`
`newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit, String key, org.eclipse.swt.events.ModifyListener sl)`
Creates a new editable text field.
`protected void`
`performDefaults()`
`boolean`
`performOk()`
`protected void`
`tabForward(org.eclipse.swt.widgets.Composite parent)`
Creates a tab of one horizontal spans.

### Methods inherited from class org.eclipse.ui.dialogs.PropertyPage

`getElement, setElement`

### Methods inherited from class org.eclipse.jface.preference.PreferencePage

`applyData, applyDialogFont, computeSize, contributeButtons, createContents, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, getApplyButton, getContainer, getDefaultsButton, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton`

### Methods inherited from class org.eclipse.jface.dialogs.DialogPage

`convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisible`

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

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

### Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage

`createControl, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible`

### Methods inherited from interface org.eclipse.jface.preference.IPreferencePage

`computeSize, isValid, okToLeave, performCancel, setContainer, setSize`

### Methods inherited from interface org.eclipse.ui.IWorkbenchPropertyPage

`getElement, setElement`

## Field Details

### checkBoxModel

protected String[][] checkBoxModel

### colorList

protected org.eclipse.swt.widgets.List colorList

### colorListModel

protected String[][] colorListModel

### colorSelector

protected org.eclipse.jface.preference.ColorSelector colorSelector

### fPreferenceeStore

protected AtlPreferenceStore fPreferenceeStore

### textFieldModel

protected String[][] textFieldModel

### properties

protected String[][] properties

### tableProperties

protected Map<org.eclipse.swt.widgets.TableItem,String> tableProperties

### preview

protected AtlPreview preview

## Constructor Details

### AbstractPropertyAndPreferencePage

public AbstractPropertyAndPreferencePage(String title)
Creates a new preference page with a title using the `PreferencePage` constructor. Above that, a new preference fPreferenceeStore is created to react with the default one of the `AtlUIPlugin`.

Parameters:
  `title` - the preference page title

## Method Details

### dispose

public void dispose()

Specified by:
  `dispose` in interface `org.eclipse.jface.dialogs.IDialogPage`
Overrides:
  `dispose` in class `org.eclipse.jface.dialogs.DialogPage`
See Also:
  - `DialogPage.dispose()`

### doGetPreferenceStore

protected org.eclipse.jface.preference.IPreferenceStore doGetPreferenceStore()

Overrides:
  `doGetPreferenceStore` in class `org.eclipse.jface.preference.PreferencePage`
See Also:
  - `PreferencePage.doGetPreferenceStore()`

### getPreferenceStore

public org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()

Overrides:
  `getPreferenceStore` in class `org.eclipse.jface.preference.PreferencePage`
See Also:
  - `PreferencePage.getPreferenceStore()`

### handleColorListSelection

protected void handleColorListSelection()
When a selection is made, the color button handles the color sets by this selection. The default implementation does nothing.

### init

public void init(org.eclipse.ui.IWorkbench workbench)

Specified by:
  `init` in interface `org.eclipse.ui.IWorkbenchPreferencePage`
See Also:
  - `IWorkbenchPreferencePage.init(org.eclipse.ui.IWorkbench)`

### initialize

protected void initialize()
Initializes the preference page with the user values. The default implementation initializes all widgets lists with there user's value.

### initializeFieldsToDefaultValues

protected void initializeFieldsToDefaultValues()
Initializes the preference page widgets with the default values.

### initializeFieldsToUserValues

protected void initializeFieldsToUserValues()
Initializes the preference page widgets with the user values.

### newCheckBoxField

protected org.eclipse.swt.widgets.Button newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label)
Creates an new checkbox instance.

Parameters:
  `parent` - the composite in which to create the checkbox
  `label` - the string to set into the checkbox
Returns:
  the new checkbox

### newCheckBoxField

protected org.eclipse.swt.widgets.Button newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label, String key)
Creates an new checkbox instance and stores it in a hash map. The default listener `checkBoxFieldListener` is associated with.

Parameters:
  `parent` - the composite in which to create the checkbox
  `label` - the string to set into the checkbox
  `key` - the string key associated
Returns:
  the new checkbox

### newCheckBoxField

protected org.eclipse.swt.widgets.Button newCheckBoxField(org.eclipse.swt.widgets.Composite parent, String label, String key, org.eclipse.swt.events.SelectionListener sl)
Creates an new checkbox instance and stores it in a hash map. A listener is associated with.

Parameters:
  `parent` - the composite in which to create the checkbox
  `label` - the string to set into the checkbox
  `key` - the string key associated
  `sl` - the selection listener associated with
Returns:
  the new checkbox

### newColorList

protected org.eclipse.swt.widgets.Control[] newColorList(org.eclipse.swt.widgets.Composite parent, String listLabel, String buttonLabel, String[][] colorListModel)
Creates a new color list with a label and a color selector button.

Parameters:
  `parent` - the parent composite group
  `listLabel` - the color list label
  `buttonLabel` - the color selector label
  `colorListModel` - the models of the color list
Returns:
  the objects' list of the group

### newComposite

protected org.eclipse.swt.widgets.Composite newComposite(org.eclipse.swt.widgets.Composite parent, int numColumns)
Creates composite control and sets the default layout data.

Parameters:
  `parent` - the parent of the new composite
  `numColumns` - the number of columns for the new composite
Returns:
  the newly-created coposite

### newCompositeCheckBoxes

protected org.eclipse.swt.widgets.Composite newCompositeCheckBoxes(org.eclipse.swt.widgets.Composite parent)

### newCompositeColors

protected org.eclipse.swt.widgets.Composite newCompositeColors(org.eclipse.swt.widgets.Composite parent, String listLabel, String buttonLabel)

### newCompositeTextFields

protected org.eclipse.swt.widgets.Composite newCompositeTextFields(org.eclipse.swt.widgets.Composite parent)

### newGroup

protected org.eclipse.swt.widgets.Group newGroup(org.eclipse.swt.widgets.Composite parent, String text)
Creates a new elements group with a title above the side.

Parameters:
  `parent` - the parent of the new group
  `text` - the title of the new group
Returns:
  the new group

### newLabelField

protected org.eclipse.swt.widgets.Label newLabelField(org.eclipse.swt.widgets.Composite parent, String text)
Utility method that creates a label instance and sets the default layout data.

Parameters:
  `parent` - the parent for the new label
  `text` - the text for the new label
Returns:
  the new label

### newLabelledTextField

protected org.eclipse.swt.widgets.Text newLabelledTextField(org.eclipse.swt.widgets.Composite parent, String label, String text, int limit, String key)
Creates a new group composed by a label and an editable text field. It is designed to work on a two columns composite.

Parameters:
  `parent` - the parent group
  `label` - the label of the group
  `text` - the default value of the text field
  `limit` - the maximum number of chars in the field
  `key` - the string key associated
Returns:
  the new composed group

### newPushButton

protected org.eclipse.swt.widgets.Button newPushButton(org.eclipse.swt.widgets.Composite parent, String text, org.eclipse.swt.events.SelectionListener sl)
Utility method that creates a push button instance and sets the default layout data.

Parameters:
  `parent` - the parent for the new button
  `text` - the label for the new button
Returns:
  the newly-created button

### newRadioButton

protected org.eclipse.swt.widgets.Button newRadioButton(org.eclipse.swt.widgets.Composite parent, String text, org.eclipse.swt.events.SelectionListener sl)
Utility method that creates a radio button instance and sets the default layout data.

Parameters:
  `parent` - the parent for the new button
  `text` - the label for the new button
Returns:
  the newly-created button

### newScrollList

protected org.eclipse.swt.widgets.List newScrollList(org.eclipse.swt.widgets.Composite parent)
Creates a new scroll list.

Parameters:
  `parent` - the parent in which the list is created
Returns:
  a new empty list

### newTabItem

protected org.eclipse.swt.widgets.TabItem newTabItem(org.eclipse.swt.widgets.TabFolder parent, String text, org.eclipse.swt.widgets.Control control)
Creates a new tab item in a tab folder.

Parameters:
  `parent` - the parent tab folder
  `text` - the tab item label
  `control` - the page of this item
Returns:
  the new tab item containing the preference page.

### newTextField

protected org.eclipse.swt.widgets.Text newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit)
Creates a new editable text field.

Parameters:
  `parent` - the parent group
  `text` - the default value of the text field
  `limit` - the maximum number of chars in the field
Returns:
  the new text field

### newTextField

protected org.eclipse.swt.widgets.Text newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit, String key)
Creates a new editable text field. The default listener `TextFieldListener` is associated with.

Parameters:
  `parent` - the parent group
  `text` - the default value of the text field
  `limit` - the maximum number of chars in the field
  `key` - the string key associated
Returns:
  the new text field

### newTextField

protected org.eclipse.swt.widgets.Text newTextField(org.eclipse.swt.widgets.Composite parent, String text, int limit, String key, org.eclipse.swt.events.ModifyListener sl)
Creates a new editable text field. A listener is associated with.

Parameters:
  `parent` - the parent group
  `text` - the default value of the text field
  `limit` - the maximum number of chars in the field
  `key` - the string key associated
  `sl` - the selection listener associated with
Returns:
  the new text field

### performDefaults

protected void performDefaults()

Overrides:
  `performDefaults` in class `org.eclipse.jface.preference.PreferencePage`
See Also:
  - `PreferencePage.performDefaults()`

### performOk

public boolean performOk()

Specified by:
  `performOk` in interface `org.eclipse.jface.preference.IPreferencePage`
Overrides:
  `performOk` in class `org.eclipse.jface.preference.PreferencePage`
See Also:
  - `PreferencePage.performOk()`

### tabForward

protected void tabForward(org.eclipse.swt.widgets.Composite parent)
Creates a tab of one horizontal spans.

Parameters:
  `parent` - the parent in which the tab should be created