Package com.biglybt.ui.config
Class ConfigSectionImpl
- java.lang.Object
-
- com.biglybt.ui.config.ConfigSectionImpl
-
- All Implemented Interfaces:
BaseConfigSection
- Direct Known Subclasses:
BasicPluginConfigImpl
,ConfigSectionBackupRestore
,ConfigSectionConnection
,ConfigSectionConnectionAdvanced
,ConfigSectionConnectionDNS
,ConfigSectionConnectionEncryption
,ConfigSectionConnectionProxy
,ConfigSectionFile
,ConfigSectionFileMove
,ConfigSectionFilePerformance
,ConfigSectionFileTorrents
,ConfigSectionFileTorrentsDecoding
,ConfigSectionHolder
,ConfigSectionInterfaceAlertsSWT
,ConfigSectionInterfaceColorSWT
,ConfigSectionInterfaceDisplaySWT
,ConfigSectionInterfaceLanguage
,ConfigSectionInterfaceLegacySWT
,ConfigSectionInterfacePasswordSWT
,ConfigSectionInterfaceStartSWT
,ConfigSectionInterfaceSWT
,ConfigSectionInterfaceTablesSWT
,ConfigSectionInterfaceTags
,ConfigSectionIPFilter
,ConfigSectionLogging
,ConfigSectionMode
,ConfigSectionPlugins
,ConfigSectionSecurity
,ConfigSectionSharing
,ConfigSectionStartShutdown
,ConfigSectionStats
,ConfigSectionTracker
,ConfigSectionTrackerClient
,ConfigSectionTrackerServer
,ConfigSectionTransfer
,ConfigSectionTransferAutoSpeedClassic
,ConfigSectionTransferAutoSpeedSelect
,ConfigSectionTransferAutoSpeedV2
,ConfigSectionTransferLAN
public abstract class ConfigSectionImpl extends java.lang.Object implements BaseConfigSection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConfigSectionImpl.ConfigDetailsCallback
-
Field Summary
Fields Modifier and Type Field Description private int
defaultMode
private java.lang.String[]
defaultUITypes
private boolean
isBuilt
static java.lang.String
L10N_SECTION_PREFIX
protected java.util.Map<java.lang.String,ParameterImpl>
mapPluginParams
private int
minUserMode
private java.lang.String
parentSectionID
private ConfigSectionRebuildRunner
rebuildRunner
private java.lang.String
sectionID
-
Constructor Summary
Constructors Constructor Description ConfigSectionImpl(java.lang.ref.WeakReference<BasicPluginConfigModel> model_ref)
ConfigSectionImpl(java.lang.String sectionID, java.lang.String parentSectionID)
ConfigSectionImpl(java.lang.String sectionID, java.lang.String parentSectionID, int minUserMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends ParameterImpl>
Tadd(java.lang.String key, T param, int minMode, java.util.List<Parameter>... otherLists)
protected <T extends ParameterImpl>
Tadd(java.lang.String key, T param, java.util.List<Parameter>... otherLists)
protected <T extends ParameterImpl>
Tadd(T param, int minMode, java.util.List<Parameter>... otherLists)
protected <T extends ParameterImpl>
Tadd(T param, java.util.List<Parameter>... otherLists)
void
deleteConfigSection()
Config view is closingjava.lang.String
findPluginParamKey(Parameter param)
java.lang.String
getConfigSectionID()
In order for the plugin to display its section correctly, a key in the Plugin language file will need to contain ConfigView.section.<getConfigSectionID() result>=The Section name.int
getMaxUserMode()
Indicate if additional options are available to display a hint to the usersint
getMinUserMode()
Returns the minimum user mode needed for this section to be displayed.Parameter[]
getParamArray()
java.lang.String
getParentSectionID()
Returns section you want your configuration panel to be under.ParameterImpl
getPluginParam(java.lang.String key)
java.lang.String
getSectionNameKey()
static java.lang.String
getSectionNameKey(java.lang.String sectionID)
protected java.lang.String
guessParamName(Parameter param, boolean warnExists)
boolean
isBuilt()
void
postBuild()
void
requestRebuild()
Request the UI to rebuild this config section.void
saveConfigSection()
User selected Save.java.util.List<Parameter>
search(java.util.regex.Pattern regex)
void
setDefaultUITypesForAdd(java.lang.String... defaultUITypes)
Any Parameters added after this call will be auto-assigned these UI Typesvoid
setDefaultUserModeForAdd(int defaultMode)
Any Parameters added after this call will be auto-assigned this user modevoid
setRebuildRunner(ConfigSectionRebuildRunner rebuildRunner)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.ui.config.BaseConfigSection
build
-
-
-
-
Field Detail
-
L10N_SECTION_PREFIX
public static final java.lang.String L10N_SECTION_PREFIX
- See Also:
- Constant Field Values
-
sectionID
private final java.lang.String sectionID
-
parentSectionID
private final java.lang.String parentSectionID
-
minUserMode
private final int minUserMode
-
defaultMode
private int defaultMode
-
isBuilt
private boolean isBuilt
-
defaultUITypes
private java.lang.String[] defaultUITypes
-
rebuildRunner
private ConfigSectionRebuildRunner rebuildRunner
-
mapPluginParams
protected final java.util.Map<java.lang.String,ParameterImpl> mapPluginParams
-
-
Constructor Detail
-
ConfigSectionImpl
public ConfigSectionImpl(java.lang.ref.WeakReference<BasicPluginConfigModel> model_ref)
-
ConfigSectionImpl
public ConfigSectionImpl(java.lang.String sectionID, java.lang.String parentSectionID)
-
ConfigSectionImpl
public ConfigSectionImpl(java.lang.String sectionID, java.lang.String parentSectionID, int minUserMode)
-
-
Method Detail
-
getConfigSectionID
public final java.lang.String getConfigSectionID()
Description copied from interface:BaseConfigSection
In order for the plugin to display its section correctly, a key in the Plugin language file will need to contain ConfigView.section.<getConfigSectionID() result>=The Section name.- Specified by:
getConfigSectionID
in interfaceBaseConfigSection
- Returns:
- The name of the configuration section
-
getParentSectionID
public final java.lang.String getParentSectionID()
Description copied from interface:BaseConfigSection
Returns section you want your configuration panel to be under. See BasicPluginConfigModel.SECTION_* constants. To add a subsection to your own ConfigSection, return the getConfigSectionID result of your parent.- Specified by:
getParentSectionID
in interfaceBaseConfigSection
-
postBuild
public final void postBuild()
- Specified by:
postBuild
in interfaceBaseConfigSection
-
isBuilt
public final boolean isBuilt()
- Specified by:
isBuilt
in interfaceBaseConfigSection
-
setDefaultUserModeForAdd
public final void setDefaultUserModeForAdd(int defaultMode)
Any Parameters added after this call will be auto-assigned this user mode
-
setDefaultUITypesForAdd
public final void setDefaultUITypesForAdd(java.lang.String... defaultUITypes)
Any Parameters added after this call will be auto-assigned these UI Types- Parameters:
defaultUITypes
-UIInstance
.UIT_SWT, UIInstance.UIT_CONSOLE, etc
-
add
@SafeVarargs protected final <T extends ParameterImpl> T add(T param, java.util.List<Parameter>... otherLists)
-
add
@SafeVarargs protected final <T extends ParameterImpl> T add(T param, int minMode, java.util.List<Parameter>... otherLists)
-
add
@SafeVarargs protected final <T extends ParameterImpl> T add(java.lang.String key, T param, java.util.List<Parameter>... otherLists)
-
add
@SafeVarargs protected final <T extends ParameterImpl> T add(java.lang.String key, T param, int minMode, java.util.List<Parameter>... otherLists)
-
guessParamName
protected java.lang.String guessParamName(Parameter param, boolean warnExists)
-
getParamArray
public final Parameter[] getParamArray()
- Specified by:
getParamArray
in interfaceBaseConfigSection
-
getPluginParam
public final ParameterImpl getPluginParam(java.lang.String key)
- Specified by:
getPluginParam
in interfaceBaseConfigSection
-
findPluginParamKey
public final java.lang.String findPluginParamKey(Parameter param)
-
saveConfigSection
public void saveConfigSection()
Description copied from interface:BaseConfigSection
User selected Save. All saving of non-plugin tabs have been completed, as well as saving of plugins that implement com.biglybt.pif.ui.config parameters.- Specified by:
saveConfigSection
in interfaceBaseConfigSection
-
deleteConfigSection
public void deleteConfigSection()
Description copied from interface:BaseConfigSection
Config view is closing- Specified by:
deleteConfigSection
in interfaceBaseConfigSection
-
getMinUserMode
public final int getMinUserMode()
Description copied from interface:BaseConfigSection
Returns the minimum user mode needed for this section to be displayed. Note: Section may be visually displayed, but with a notification that modification is unavailable at current user mode.- Specified by:
getMinUserMode
in interfaceBaseConfigSection
- See Also:
Parameter.MODE_BEGINNER
,Parameter.MODE_INTERMEDIATE
,Parameter.MODE_ADVANCED
-
setRebuildRunner
public void setRebuildRunner(ConfigSectionRebuildRunner rebuildRunner)
- Specified by:
setRebuildRunner
in interfaceBaseConfigSection
-
requestRebuild
public void requestRebuild()
Description copied from interface:BaseConfigSection
Request the UI to rebuild this config section. For SWT, all SWT objects will be disposed and recreated.- Specified by:
requestRebuild
in interfaceBaseConfigSection
-
getMaxUserMode
public final int getMaxUserMode()
Description copied from interface:BaseConfigSection
Indicate if additional options are available to display a hint to the users- Specified by:
getMaxUserMode
in interfaceBaseConfigSection
- Returns:
- the highest user mode that reveals additional options (0 = Beginner, 1 = Intermediate, 2 = Advanced)
-
getSectionNameKey
public java.lang.String getSectionNameKey()
- Specified by:
getSectionNameKey
in interfaceBaseConfigSection
-
getSectionNameKey
public static java.lang.String getSectionNameKey(java.lang.String sectionID)
-
search
public java.util.List<Parameter> search(java.util.regex.Pattern regex)
- Specified by:
search
in interfaceBaseConfigSection
-
-