Class WebPage.Builder<B extends WebPage.Builder<B>>

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

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

    • Builder

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

    • build

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

      public B onConsoleMessageSent(WebPage.ConsoleMessageSentCallback handler)
      Emitted when a message is sent to the console. This can be a message produced by the use of JavaScript console API, a JavaScript exception, a security error or other errors, warnings, debug or log messages. The consoleMessage contains information of the message.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.12
      See Also:
    • onContextMenu

      public B onContextMenu(WebPage.ContextMenuCallback handler)
      Emitted before a context menu is displayed in the UI Process to give the application a chance to customize the proposed menu, build its own context menu or pass user data to the UI Process. This signal is useful when the information available in the UI Process is not enough to build or customize the context menu, for example, to add menu entries depending on the node at the coordinates of the hitTestResult. Otherwise, it's recommended to use WebKitWebView::context-menu signal instead.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.8
      See Also:
    • onDocumentLoaded

      public B onDocumentLoaded(WebPage.DocumentLoadedCallback handler)

      This signal is emitted when the DOM document of a WebKitWebPage has been loaded.

      You can wait for this signal to get the DOM document

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

      public B onSendRequest(WebPage.SendRequestCallback handler)

      This signal is emitted when request is about to be sent to the server. This signal can be used to modify the WebKitURIRequest that will be sent to the server. You can also cancel the resource load operation by connecting to this signal and returning true.

      In case of a server redirection this signal is emitted again with the request argument containing the new request to be sent to the server due to the redirection and the redirectedResponse parameter containing the response received by the server for the initial request.

      Modifications to the WebKitURIRequest and its associated SoupMessageHeaders will be taken into account when the request is sent over the network.

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

      public B onUserMessageReceived(WebPage.UserMessageReceivedCallback handler)

      This signal is emitted when a WebKitUserMessage is received from the WebKitWebView corresponding to webPage. 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 returning true. If the last reference of message is removed and the message has been replied, the operation in the WebKitWebView will finish with error UserMessageError.USER_MESSAGE_UNHANDLED_MESSAGE.

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