tweak.BaseSetting Extends goog.tweak.BaseEntry
Base class for all tweak entries that are settings. Settings are entries that are associated with a query parameter.

Inheritance

Constructor

goog.tweak.BaseSetting(iddescription)

Parameters

id : string
The ID for the setting.
description : string
A description of what the setting does.

Instance Methods

Public Protected Private
assertNotInitialized(funcName)
Asserts that this tweak has not been initialized yet.
Arguments:
funcName : string
Function name to use in the assertion message.
code »
ensureInitialized()
Applies the default value or query param value if this is the first time that the function has been called.
code »
getNewValueEncoded() ?string
Returns the value to be used in the query parameter for this tweak.
Returns: ?string  The encoded value. Null if the value is set to its default.
code »
getParamName() ?string
Returns the name of the query parameter used for this setting.
Returns: ?string  The param name. Null if no query parameter is directly associated with the setting.
code »
initialize(value)
Sets the value of the entry based on the value of the query parameter. Once this is called, configuration settings (associated query parameter, token, etc) may not be changed.
Arguments:
value : ?string
The part of the query param for this setting after the '='. Null if it is not present.
code »
isInitializing() boolean
Returns whether the setting is currently being initialized.
Returns: boolean  Whether the setting is currently being initialized.
code »
setInitialQueryParamValue(value)
Sets the initial query parameter value for this setting. May not be called after the setting has been initialized.
Arguments:
value : string
The inital query parameter value for this setting.
code »
setParamName(value)
Sets the name of the query parameter used for this setting. If null is passed the the setting will not appear in the top-level query string.
Arguments:
value : ?string
The new value.
code »
addCallback(callback)
Adds a callback that should be called when the setting has changed (or when an action has been clicked).
Arguments:
callback : !Function
The callback to add.
code »
fireCallbacks()
Calls all registered callbacks.
code »
getId() string
No description.
Returns: string  Returns the entry's ID.
code »
isRestartRequired() boolean
Returns whether a restart is required for changes to the setting to take effect.
Returns: boolean  The value.
code »
removeCallback(callback)
Removes a callback that was added by addCallback.
Arguments:
callback : !Function
The callback to add.
code »
setRestartRequired(value)
Sets whether a restart is required for changes to the setting to take effect.
Arguments:
value : boolean
The new value.
code »

Instance Properties

constructor :
No description.
Code »
initialQueryParamValue :
The value of this setting's query parameter.
Code »
initializeState_ :
Whether initialize() has been called (or is in the middle of being called).
Code »
The logger for this class.
Code »
paramName_ :
The query parameter that controls this setting.
Code »
callbacks_ :
Functions to be called whenever a setting is changed or a button is clicked.
Code »
description :
A description of what this entry does.
Code »
id_ :
An ID to uniquely identify the entry.
Code »
label :
A descriptive label for the entry.
Code »
The logger for this class.
Code »
restartRequired_ :
Whether a restart is required for changes to the setting to take effect.
Code »

Static Properties

goog.tweak.BaseSetting.superClass_ :
No description.
Code »

Enumerations

goog.tweak.BaseSetting.InitializeState_ :
States of initialization. Entries are initialized lazily in order to allow their initialization to happen in multiple statements.
Constants:
INITIALIZED
No description.
INITIALIZING
No description.
NOT_INITIALIZED
No description.
Code »

Package tweak

Package Reference