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 java.lang.String[][]
checkBoxModel
protected org.eclipse.swt.widgets.List
colorList
protected java.lang.String[][]
colorListModel
protected org.eclipse.jface.preference.ColorSelector
colorSelector
protected AtlPreferenceStore
fPreferenceeStore
protected AtlPreview
preview
protected java.lang.String[][]
properties
protected java.util.Map<org.eclipse.swt.widgets.TableItem,java.lang.String>
tableProperties
protected java.lang.String[][]
textFieldModel
-
Constructor Summary
Constructors Constructor Description AbstractPropertyAndPreferencePage(java.lang.String title)
Creates a new preference page with a title using thePreferencePage
constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods 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, java.lang.String label)
Creates an new checkbox instance.protected org.eclipse.swt.widgets.Button
newCheckBoxField(org.eclipse.swt.widgets.Composite parent, java.lang.String label, java.lang.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, java.lang.String label, java.lang.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, java.lang.String listLabel, java.lang.String buttonLabel, java.lang.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, java.lang.String listLabel, java.lang.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, java.lang.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, java.lang.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, java.lang.String label, java.lang.String text, int limit, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.String text, int limit)
Creates a new editable text field.protected org.eclipse.swt.widgets.Text
newTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String text, int limit, java.lang.String key)
Creates a new editable text field.protected org.eclipse.swt.widgets.Text
newTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String text, int limit, java.lang.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.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
-
-
-
-
Field Detail
-
checkBoxModel
protected java.lang.String[][] checkBoxModel
-
colorList
protected org.eclipse.swt.widgets.List colorList
-
colorListModel
protected java.lang.String[][] colorListModel
-
colorSelector
protected org.eclipse.jface.preference.ColorSelector colorSelector
-
fPreferenceeStore
protected AtlPreferenceStore fPreferenceeStore
-
textFieldModel
protected java.lang.String[][] textFieldModel
-
properties
protected java.lang.String[][] properties
-
tableProperties
protected java.util.Map<org.eclipse.swt.widgets.TableItem,java.lang.String> tableProperties
-
preview
protected AtlPreview preview
-
-
Constructor Detail
-
AbstractPropertyAndPreferencePage
public AbstractPropertyAndPreferencePage(java.lang.String title)
Creates a new preference page with a title using thePreferencePage
constructor. Above that, a new preference fPreferenceeStore is created to react with the default one of theAtlUIPlugin
.- Parameters:
title
- the preference page title
-
-
Method Detail
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.jface.dialogs.IDialogPage
- Overrides:
dispose
in classorg.eclipse.jface.dialogs.DialogPage
- See Also:
DialogPage.dispose()
-
doGetPreferenceStore
protected org.eclipse.jface.preference.IPreferenceStore doGetPreferenceStore()
- Overrides:
doGetPreferenceStore
in classorg.eclipse.jface.preference.PreferencePage
- See Also:
PreferencePage.doGetPreferenceStore()
-
getPreferenceStore
public org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
- Overrides:
getPreferenceStore
in classorg.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 interfaceorg.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, java.lang.String label)
Creates an new checkbox instance.- Parameters:
parent
- the composite in which to create the checkboxlabel
- 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, java.lang.String label, java.lang.String key)
Creates an new checkbox instance and stores it in a hash map. The default listenercheckBoxFieldListener
is associated with.- Parameters:
parent
- the composite in which to create the checkboxlabel
- the string to set into the checkboxkey
- the string key associated- Returns:
- the new checkbox
-
newCheckBoxField
protected org.eclipse.swt.widgets.Button newCheckBoxField(org.eclipse.swt.widgets.Composite parent, java.lang.String label, java.lang.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 checkboxlabel
- the string to set into the checkboxkey
- the string key associatedsl
- the selection listener associated with- Returns:
- the new checkbox
-
newColorList
protected org.eclipse.swt.widgets.Control[] newColorList(org.eclipse.swt.widgets.Composite parent, java.lang.String listLabel, java.lang.String buttonLabel, java.lang.String[][] colorListModel)
Creates a new color list with a label and a color selector button.- Parameters:
parent
- the parent composite grouplistLabel
- the color list labelbuttonLabel
- the color selector labelcolorListModel
- 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 compositenumColumns
- 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, java.lang.String listLabel, java.lang.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, java.lang.String text)
Creates a new elements group with a title above the side.- Parameters:
parent
- the parent of the new grouptext
- the title of the new group- Returns:
- the new group
-
newLabelField
protected org.eclipse.swt.widgets.Label newLabelField(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
Utility method that creates a label instance and sets the default layout data.- Parameters:
parent
- the parent for the new labeltext
- the text for the new label- Returns:
- the new label
-
newLabelledTextField
protected org.eclipse.swt.widgets.Text newLabelledTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String label, java.lang.String text, int limit, java.lang.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 grouplabel
- the label of the grouptext
- the default value of the text fieldlimit
- the maximum number of chars in the fieldkey
- the string key associated- Returns:
- the new composed group
-
newPushButton
protected org.eclipse.swt.widgets.Button newPushButton(org.eclipse.swt.widgets.Composite parent, java.lang.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 buttontext
- 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, java.lang.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 buttontext
- 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, java.lang.String text, org.eclipse.swt.widgets.Control control)
Creates a new tab item in a tab folder.- Parameters:
parent
- the parent tab foldertext
- the tab item labelcontrol
- 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, java.lang.String text, int limit)
Creates a new editable text field.- Parameters:
parent
- the parent grouptext
- the default value of the text fieldlimit
- 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, java.lang.String text, int limit, java.lang.String key)
Creates a new editable text field. The default listenerTextFieldListener
is associated with.- Parameters:
parent
- the parent grouptext
- the default value of the text fieldlimit
- the maximum number of chars in the fieldkey
- the string key associated- Returns:
- the new text field
-
newTextField
protected org.eclipse.swt.widgets.Text newTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String text, int limit, java.lang.String key, org.eclipse.swt.events.ModifyListener sl)
Creates a new editable text field. A listener is associated with.- Parameters:
parent
- the parent grouptext
- the default value of the text fieldlimit
- the maximum number of chars in the fieldkey
- the string key associatedsl
- the selection listener associated with- Returns:
- the new text field
-
performDefaults
protected void performDefaults()
- Overrides:
performDefaults
in classorg.eclipse.jface.preference.PreferencePage
- See Also:
PreferencePage.performDefaults()
-
performOk
public boolean performOk()
- Specified by:
performOk
in interfaceorg.eclipse.jface.preference.IPreferencePage
- Overrides:
performOk
in classorg.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
-
-