Class AbstractPreferencePageProvider
- java.lang.Object
-
- com.e1c.g5.v8.dt.formatter.ui.preferences.page.builders.AbstractPreferencePageProvider
-
- All Implemented Interfaces:
IPreferencePageProvider
- Direct Known Subclasses:
BslPreferencePageProvider
public abstract class AbstractPreferencePageProvider extends Object implements IPreferencePageProvider
Abstract implementation ofIPreferencePageProvider
that usesIOptionFactory
to create options. Delegates toIPreferenceTabFolderProvider
to performcompose(Composite)
-
-
Constructor Summary
Constructors Constructor Description AbstractPreferencePageProvider(IOptionFactory optionFactory, IOptionProvider defaultOptionProvider)
Creates new instance with givenIOptionFactory
and initializespreferenceTabFolderProvider
withcreatePreferenceTabFolderProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addBooleanOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Adds new store based boolean option in the given tab with given group and given preference keyvoid
addIntegerOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Adds new store based Integer option in the given tab with given group and given preference keyvoid
addMultiStringOption(String tabName, String groupName, String preferenceKey, String presentation, String[] options, String[] optionPresentations, org.eclipse.jface.preference.IPreferenceStore store)
Adds new manager based chose-one string option in the given tab with given group and given preference keyvoid
addStringOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Adds new store based string option in the given tab with given group and given preference keyvoid
compose(org.eclipse.swt.widgets.Composite parent)
Creates UI representation of options collected with#addBooleanOption(String, String, String, String, IPreferenceStore, boolean, boolean)
,#addIntegerOption(String, String, String, String, IPreferenceStore, boolean, boolean)
#addMultiStringOption(String, String, String, String, String[], String[], IPreferenceStore, boolean, boolean)
and#addStringOption(String, String, String, String, IPreferenceStore, boolean, boolean)
methodsprotected abstract IPreferenceTabFolderProvider
createPreferenceTabFolderProvider()
Creates new instance ofIPreferenceTabFolderProvider
void
enableShowWhitespaceCharactersOption(String preferenceKey, org.eclipse.jface.preference.IPreferenceStore store)
Creates a specific option for each preview that lets user to turn on/off showing of whitespace charactersvoid
setOptionProvider(String tabName, IOptionProvider optionProvider)
Sets option provider for the preview in the given tabvoid
setPreview(String tabName, String previewText)
Sets given previewText and given previewFromatter for the tab with given tabName
-
-
-
Constructor Detail
-
AbstractPreferencePageProvider
public AbstractPreferencePageProvider(IOptionFactory optionFactory, IOptionProvider defaultOptionProvider)
Creates new instance with givenIOptionFactory
and initializespreferenceTabFolderProvider
withcreatePreferenceTabFolderProvider()
- Parameters:
optionFactory
- The option factory to set onoptionFactory
, cannot benull
defaultOptionProvider
- The provider for options, can benull
if all tabs are configured manually withsetOptionProvider(String, IOptionProvider)
-
-
Method Detail
-
addMultiStringOption
public void addMultiStringOption(String tabName, String groupName, String preferenceKey, String presentation, String[] options, String[] optionPresentations, org.eclipse.jface.preference.IPreferenceStore store)
Description copied from interface:IPreferencePageProvider
Adds new manager based chose-one string option in the given tab with given group and given preference key- Specified by:
addMultiStringOption
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The name of the tab that holds this option, cannot benull
groupName
- The name of the group that hold this option, can benull
preferenceKey
- The preference key of the option, cannot benull
presentation
- The presentation text to set on associated label, cannot benull
options
- The options that can be chosen from the list, cannot benull
optionPresentations
- The localized options presentation, cannot benull
store
- The store which is bound to this option. Any set/get will be adjusted with it, can benull
-
addBooleanOption
public void addBooleanOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Description copied from interface:IPreferencePageProvider
Adds new store based boolean option in the given tab with given group and given preference key- Specified by:
addBooleanOption
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The name of the tab that holds this option, cannot benull
groupName
- The name of the group that hold this option, can benull
preferenceKey
- The preference key of the option, cannot benull
presentation
- The presentation text to set on associated label, cannot benull
store
- The store which is bound to this option. Any set/get will be adjusted with it, can benull
-
addStringOption
public void addStringOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Description copied from interface:IPreferencePageProvider
Adds new store based string option in the given tab with given group and given preference key- Specified by:
addStringOption
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The name of the tab that holds this option, cannot benull
groupName
- The name of the group that hold this option, can benull
preferenceKey
- The preference key of the option, cannot benull
presentation
- The presentation text to set on associated label, cannot benull
store
- The store which is bound to this option. Any set/get will be adjusted with it, can benull
-
addIntegerOption
public void addIntegerOption(String tabName, String groupName, String preferenceKey, String presentation, org.eclipse.jface.preference.IPreferenceStore store)
Description copied from interface:IPreferencePageProvider
Adds new store based Integer option in the given tab with given group and given preference key- Specified by:
addIntegerOption
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The name of the tab that holds this option, cannot benull
groupName
- The name of the group that hold this option, can benull
preferenceKey
- The preference key of the option, cannot benull
presentation
- The presentation text to set on associated label, cannot benull
-
compose
public void compose(org.eclipse.swt.widgets.Composite parent)
Description copied from interface:IPreferencePageProvider
Creates UI representation of options collected with#addBooleanOption(String, String, String, String, IPreferenceStore, boolean, boolean)
,#addIntegerOption(String, String, String, String, IPreferenceStore, boolean, boolean)
#addMultiStringOption(String, String, String, String, String[], String[], IPreferenceStore, boolean, boolean)
and#addStringOption(String, String, String, String, IPreferenceStore, boolean, boolean)
methods- Specified by:
compose
in interfaceIPreferencePageProvider
- Parameters:
parent
- The composite parent on which UI shall be built on, cannot benull
-
setPreview
public void setPreview(String tabName, String previewText)
Description copied from interface:IPreferencePageProvider
Sets given previewText and given previewFromatter for the tab with given tabName- Specified by:
setPreview
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The name of the tab to set preview preferences on, cannot benull
previewText
- The text of preview(code example to be formatted), can benull
-
enableShowWhitespaceCharactersOption
public void enableShowWhitespaceCharactersOption(String preferenceKey, org.eclipse.jface.preference.IPreferenceStore store)
Description copied from interface:IPreferencePageProvider
Creates a specific option for each preview that lets user to turn on/off showing of whitespace characters- Specified by:
enableShowWhitespaceCharactersOption
in interfaceIPreferencePageProvider
- Parameters:
preferenceKey
- The preference key of this option, cannot benull
store
- The related preference store, can benull
-
setOptionProvider
public void setOptionProvider(String tabName, IOptionProvider optionProvider)
Description copied from interface:IPreferencePageProvider
Sets option provider for the preview in the given tab- Specified by:
setOptionProvider
in interfaceIPreferencePageProvider
- Parameters:
tabName
- The tab name to set option provider tooptionProvider
- The option provider that is set to the given tab
-
createPreferenceTabFolderProvider
protected abstract IPreferenceTabFolderProvider createPreferenceTabFolderProvider()
Creates new instance ofIPreferenceTabFolderProvider
- Returns:
- new instance of
IPreferenceTabFolderProvider
, cannot benull
-
-