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 theSettingsobject.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 thisSettingsobject.setSettingsSchema(SettingsSchema settingsSchema) TheGio.SettingsSchemadescribing the types of keys for thisSettingsobject.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theSettingsobject. 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:
buildin classGObject.Builder<B extends Settings.Builder<B>>- Returns:
- a new instance of
Settingswith 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 thebackendproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setPath
-
setSchema
Deprecated.Use theGio.Settings:schema-idproperty instead. In a future version, this property may instead refer to aGio.SettingsSchema.The name of the schema that describes the types of keys for thisSettingsobject.The type of this property is not
Gio.SettingsSchema.Gio.SettingsSchemahas 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-schemaproperty if you wish to pass in aGio.SettingsSchema.- Parameters:
schema- the value for theschemaproperty- Returns:
- the
Builderinstance is returned, to allow method chaining
-
setSchemaId
-
setSettingsSchema
TheGio.SettingsSchemadescribing the types of keys for thisSettingsobject.Ideally, this property would be called
Gio.Settings:schema.Gio.SettingsSchemahas only existed since version 2.32, however, and before then theGio.Settings:schemaproperty was used to refer to the ID of the schema rather than the schema itself. Take care.- Parameters:
settingsSchema- the value for thesettings-schemaproperty- Returns:
- the
Builderinstance 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::changedsignal. For most use cases it is more appropriate to use theGio.Settings::changedsignal.In the event that the change event applies to one or more specified keys,
keyswill be an array ofGLib.Quarks of lengthnKeys.In the event that the change event applies to theSettingsobject as a whole (ie: potentially every key has been changed) thenkeyswill beNULLandnKeyswill be0.The default handler for this signal invokes the
Gio.Settings::changedsignal 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
Builderinstance 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::xin order to only receive callbacks when keyxchanges.Note that
settingsonly emits this signal if you have readkeyat least once while a signal handler was already connected forkey.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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-changedsignal. For most use cases it is more appropriate to use theGio.Settings::writable-changedsignal.In the event that the writability change applies only to a single key,
keywill be set to theGLib.Quarkfor that key. In the event that the writability change affects the entire settings object,keywill be0.The default handler for this signal invokes the
Gio.Settings::writable-changedandGio.Settings::changedsignals 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
Builderinstance is returned, to allow method chaining - See Also:
-
onWritableChanged
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::xin order to only receive callbacks when the writability ofxchanges.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
Gio.Settings:schema-idproperty instead.