|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.updater.SettingsController
public class SettingsController
Controller class to get settings values. Settings are kept in-memory. Users of this class must first load the settings before changing them and save them when modified.
Settings are enumerated by constants inISettingsPage.
| Nested Class Summary | |
|---|---|
static interface |
SettingsController.OnChangedListener
|
static class |
SettingsController.Settings
|
| Constructor Summary | |
|---|---|
|
SettingsController(com.android.utils.ILogger sdkLog)
Constructs a new default SettingsController. |
protected |
SettingsController(com.android.utils.ILogger sdkLog,
SettingsController.Settings settings)
Specialized constructor that wraps an existing SettingsController.Settings instance. |
| Method Summary | |
|---|---|
void |
applySettings()
Applies the current settings. |
SettingsController.Settings |
getSettings()
|
void |
loadSettings()
Load settings from the settings file. |
void |
registerOnChangedListener(SettingsController.OnChangedListener listener)
|
void |
saveSettings()
Saves settings to the settings file. |
void |
setMonitorDensity(int density)
Sets the value of the ISettingsPage.KEY_MONITOR_DENSITY setting. |
void |
setSettingsPage(ISettingsPage settingsPage)
Associate the given ISettingsPage with this SettingsController. |
void |
setShowUpdateOnly(boolean enabled)
Sets the value of the ISettingsPage.KEY_SHOW_UPDATE_ONLY setting. |
void |
unregisterOnChangedListener(SettingsController.OnChangedListener listener)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SettingsController(@NonNull
com.android.utils.ILogger sdkLog)
SettingsController.
sdkLog - A non-null logger to use.
protected SettingsController(@NonNull
com.android.utils.ILogger sdkLog,
@NonNull
SettingsController.Settings settings)
SettingsController.Settings instance.
This is mostly used in unit-tests to override settings that are being used.
Normal usage should NOT need to call this constructor.
sdkLog - A non-null logger to use.settings - A non-null SettingsController.Settings to use as-is. It is not duplicated.| Method Detail |
|---|
public SettingsController.Settings getSettings()
public void registerOnChangedListener(SettingsController.OnChangedListener listener)
public void unregisterOnChangedListener(SettingsController.OnChangedListener listener)
public void setShowUpdateOnly(boolean enabled)
ISettingsPage.KEY_SHOW_UPDATE_ONLY setting.
enabled - True if only compatible non-obsolete update items should be shown.ISettingsPage.KEY_SHOW_UPDATE_ONLYpublic void setMonitorDensity(int density)
ISettingsPage.KEY_MONITOR_DENSITY setting.
density - the density of the monitorISettingsPage.KEY_MONITOR_DENSITYpublic void setSettingsPage(ISettingsPage settingsPage)
ISettingsPage with this SettingsController.
This loads the current properties into the setting page UI.
It then associates the SettingsChanged callback with this controller.
If the setting page given is null, it will be unlinked from controller.
settingsPage - An ISettingsPage to associate with the controller.public void loadSettings()
public void saveSettings()
public void applySettings()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||