Package org.gnome.webkit
Class WebContext.Builder<B extends WebContext.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.webkit.WebContext.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
WebContext
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theWebContext
object.This signal is emitted when a new automation request is made.This signal is emitted when aWebKitWebContext
needs to set initial notification permissions for a web process.This signal is emitted when a new web process is about to be launched.This signal is emitted when aWebKitUserMessage
is received from a web process extension.setMemoryPressureSettings
(MemoryPressureSettings memoryPressureSettings) TheWebKitMemoryPressureSettings
applied to the web processes created by this context.setTimeZoneOverride
(String timeZoneOverride) The timezone override for this web context.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 theWebContext
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 toWebContext
.- Overrides:
build
in classGObject.Builder<B extends WebContext.Builder<B>>
- Returns:
- a new instance of
WebContext
with the properties that were set in the Builder object. - Throws:
UnsupportedPlatformException
- when run on an unsupported platform
-
setMemoryPressureSettings
TheWebKitMemoryPressureSettings
applied to the web processes created by this context.- Parameters:
memoryPressureSettings
- the value for thememory-pressure-settings
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setTimeZoneOverride
The timezone override for this web context. Setting this property provides a better alternative to configure the timezone information for all webviews managed by the WebContext. The other, less optimal, approach is to globally set the TZ environment variable in the process before creating the context. However this approach might not be very convenient and can have side-effects in your application.The expected values for this property are defined in the IANA timezone database. See this wikipedia page for instance, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
- Parameters:
timeZoneOverride
- the value for thetime-zone-override
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onAutomationStarted
This signal is emitted when a new automation request is made. Note that it will never be emitted if automation is not enabled incontext
, see webkit_web_context_set_automation_allowed() for more details.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onInitializeNotificationPermissions
public B onInitializeNotificationPermissions(WebContext.InitializeNotificationPermissionsCallback handler) This signal is emitted when aWebKitWebContext
needs to set initial notification permissions for a web process. It is emitted when a new web process is about to be launched, and signals the most appropriate moment to use webkit_web_context_initialize_notification_permissions(). If no notification permissions have changed since the last time this signal was emitted, then there is no need to call webkit_web_context_initialize_notification_permissions() again.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onInitializeWebProcessExtensions
public B onInitializeWebProcessExtensions(WebContext.InitializeWebProcessExtensionsCallback handler) This signal is emitted when a new web process is about to be launched. It signals the most appropriate moment to use webkit_web_context_set_web_process_extensions_initialization_user_data() and webkit_web_context_set_web_process_extensions_directory().- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onUserMessageReceived
This signal is emitted when aWebKitUserMessage
is received from a web process extension. You can reply to the message using webkit_user_message_send_reply().You can handle the user message asynchronously by calling g_object_ref() on
message
and returningtrue
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-