Class Settings.Builder<B extends Settings.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Settings
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSettings
object.onChanged
(@Nullable String detail, Settings.ChangedCallback handler) The "changed" signal is emitted when a key has potentially changed.The "change-event" signal is emitted once per change event that affects this settings object.onWritableChanged
(@Nullable String detail, Settings.WritableChangedCallback handler) The "writable-changed" signal is emitted when the writability of a key has potentially changed.The "writable-change-event" signal is emitted once per writability change event that affects this settings object.setBackend
(SettingsBackend backend) The name of the context that the settings are stored in.The path within the backend where the settings are stored.Deprecated.setSchemaId
(String schemaId) The name of the schema that describes the types of keys for thisGSettings
object.setSettingsSchema
(SettingsSchema settingsSchema) TheGSettingsSchema
describing the types of keys for thisGSettings
object.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theSettings
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toSettings
.- Overrides:
build
in classGObject.Builder<B extends Settings.Builder<B>>
- Returns:
- a new instance of
Settings
with the properties that were set in the Builder object.
-
setBackend
The name of the context that the settings are stored in.- Parameters:
backend
- the value for thebackend
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setPath
-
setSchema
Deprecated.The name of the schema that describes the types of keys for thisGSettings
object.The type of this property is not
GSettingsSchema
.GSettingsSchema
has only existed since version 2.32 and unfortunately this name was used in previous versions to refer to the schema ID rather than the schema itself. Take care to use the 'settings-schema' property if you wish to pass in aGSettingsSchema
.- Parameters:
schema
- the value for theschema
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSchemaId
-
setSettingsSchema
TheGSettingsSchema
describing the types of keys for thisGSettings
object.Ideally, this property would be called 'schema'.
GSettingsSchema
has only existed since version 2.32, however, and before then the 'schema' property was used to refer to the ID of the schema rather than the schema itself. Take care.- Parameters:
settingsSchema
- the value for thesettings-schema
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onChangeEvent
The "change-event" signal is emitted once per change event that affects this settings object. You should connect to this signal only if you are interested in viewing groups of changes before they are split out into multiple emissions of the "changed" signal. For most use cases it is more appropriate to use the "changed" signal.In the event that the change event applies to one or more specified keys,
keys
will be an array ofGQuark
of lengthnKeys
. In the event that the change event applies to theGSettings
object as a whole (ie: potentially every key has been changed) thenkeys
will benull
andnKeys
will be 0.The default handler for this signal invokes the "changed" signal for each affected key. If any other connected handler returns
true
then this default functionality will be suppressed.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onChanged
The "changed" signal is emitted when a key has potentially changed. You should call one of the g_settings_get() calls to check the new value.This signal supports detailed connections. You can connect to the detailed signal "changed::x" in order to only receive callbacks when key "x" changes.
Note that
settings
only emits this signal if you have readkey
at least once while a signal handler was already connected forkey
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onWritableChangeEvent
The "writable-change-event" signal is emitted once per writability change event that affects this settings object. You should connect to this signal if you are interested in viewing groups of changes before they are split out into multiple emissions of the "writable-changed" signal. For most use cases it is more appropriate to use the "writable-changed" signal.In the event that the writability change applies only to a single key,
key
will be set to theGQuark
for that key. In the event that the writability change affects the entire settings object,key
will be 0.The default handler for this signal invokes the "writable-changed" and "changed" signals for each affected key. This is done because changes in writability might also imply changes in value (if for example, a new mandatory setting is introduced). If any other connected handler returns
true
then this default functionality will be suppressed.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onWritableChanged
public B onWritableChanged(@Nullable @Nullable String detail, Settings.WritableChangedCallback handler) The "writable-changed" signal is emitted when the writability of a key has potentially changed. You should call g_settings_is_writable() in order to determine the new status.This signal supports detailed connections. You can connect to the detailed signal "writable-changed::x" in order to only receive callbacks when the writability of "x" changes.
- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-