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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSettings
object.onChanged
(@Nullable String detail, Settings.ChangedCallback handler) Emitted when a key has potentially changed.Emitted once per change event that affects this settings object.onWritableChanged
(@Nullable String detail, Settings.WritableChangedCallback handler) Emitted when the writability of a key has potentially changed.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 thisSettings
object.setSettingsSchema
(SettingsSchema settingsSchema) TheGio.SettingsSchema
describing the types of keys for thisSettings
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 thisSettings
object.The type of this property is not
Gio.SettingsSchema
.Gio.SettingsSchema
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 theGio.Settings:settings-schema
property if you wish to pass in aGio.SettingsSchema
.- Parameters:
schema
- the value for theschema
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSchemaId
-
setSettingsSchema
TheGio.SettingsSchema
describing the types of keys for thisSettings
object.Ideally, this property would be called
Gio.Settings:schema
.Gio.SettingsSchema
has only existed since version 2.32, however, and before then theGio.Settings: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
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
Gio.Settings::changed
signal. For most use cases it is more appropriate to use theGio.Settings::changed
signal.In the event that the change event applies to one or more specified keys,
keys
will be an array ofGLib.Quark
s of lengthnKeys
. In the event that the change event applies to theSettings
object as a whole (ie: potentially every key has been changed) thenkeys
will beNULL
andnKeys
will be0
.The default handler for this signal invokes the
Gio.Settings::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
Emitted when a key has potentially changed.You should call one of the
Settings.get(java.lang.String, java.lang.String, java.lang.Object...)
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 keyx
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
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
Gio.Settings::writable-changed
signal. For most use cases it is more appropriate to use theGio.Settings::writable-changed
signal.In the event that the writability change applies only to a single key,
key
will be set to theGLib.Quark
for that key. In the event that the writability change affects the entire settings object,key
will be0
.The default handler for this signal invokes the
Gio.Settings::writable-changed
andGio.Settings::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) Emitted when the writability of a key has potentially changed.You should call
Settings.isWritable(java.lang.String)
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 ofx
changes.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-