Class UserContentManager.Builder<B extends UserContentManager.Builder<B>>

java.lang.Object
org.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.webkitgtk.UserContentManager.Builder<B>
Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
UserContentManager

public static class UserContentManager.Builder<B extends UserContentManager.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
2.6
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public UserContentManager build()
      Finish building the UserContentManager object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to UserContentManager.
      Overrides:
      build in class GObject.Builder<B extends UserContentManager.Builder<B>>
      Returns:
      a new instance of UserContentManager with the properties that were set in the Builder object.
    • onScriptMessageReceived

      public B onScriptMessageReceived(@Nullable String detail, UserContentManager.ScriptMessageReceivedCallback handler)
      This signal is emitted when JavaScript in a web view calls window.webkit.messageHandlers..postMessage(), after registering using webkit_user_content_manager_register_script_message_handler()
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.8
      See Also:
    • onScriptMessageWithReplyReceived

      public B onScriptMessageWithReplyReceived(@Nullable String detail, UserContentManager.ScriptMessageWithReplyReceivedCallback handler)

      This signal is emitted when JavaScript in a web view calls window.webkit.messageHandlers..postMessage(), after registering using webkit_user_content_manager_register_script_message_handler_with_reply()

      The given reply can be used to send a return value with webkit_script_message_reply_return_value() or an error message with webkit_script_message_reply_return_error_message(). If none of them are called, an automatic reply with an undefined value will be sent.

      It is possible to handle the reply asynchronously, by simply calling g_object_ref() on the reply and returning true.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.40
      See Also: