Class WebEngineBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.web.WebEngineBuilder
The
WebEngineBuilder class constructs instances of the WebEngine class
and offers a fluent interface for creating and configuring it.
This class includes a static create method that accepts the same arguments as the original WebEngine constructor
and returns an instance of the WebEngineBuilder.
You can use method chaining to call the builder methods for configuring the WebEngine.
Finally, invoke the build method to generate an instance of the WebEngine class.
Note that intermediate builder methods are not evaluated until the build method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionApplies a function to the WebEngine instance being constructed.build()Builds and returns an instance of theWebEngineclass.confirmHandler(Callback<String, Boolean> handler) A builder method that invokes thesetConfirmHandlermethod on the instance being constructed.Applies a function to theconfirmHandlerPropertyof the instance being constructed.static WebEngineBuildercreate()Returns an instance of theWebEngineBuilder.static WebEngineBuilderAccepts the constructor arguments ofWebEngine(String)and returns an instance ofWebEngineBuilder.createPopupHandler(Callback<PopupFeatures, WebEngine> handler) A builder method that invokes thesetCreatePopupHandlermethod on the instance being constructed.Applies a function to thecreatePopupHandlerPropertyof the instance being constructed.Applies a function to thedocumentPropertyof the instance being constructed.javaScriptEnabled(boolean value) A builder method that invokes thesetJavaScriptEnabledmethod on the instance being constructed.Applies a function to thejavaScriptEnabledPropertyof the instance being constructed.Applies a function to thelocationPropertyof the instance being constructed.onAlert(EventHandler<WebEvent<String>> handler) A builder method that invokes thesetOnAlertmethod on the instance being constructed.Applies a function to theonAlertPropertyof the instance being constructed.onError(EventHandler<WebErrorEvent> handler) A builder method that invokes thesetOnErrormethod on the instance being constructed.Applies a function to theonErrorPropertyof the instance being constructed.onResized(EventHandler<WebEvent<Rectangle2D>> handler) A builder method that invokes thesetOnResizedmethod on the instance being constructed.Applies a function to theonResizedPropertyof the instance being constructed.onStatusChanged(EventHandler<WebEvent<String>> handler) A builder method that invokes thesetOnStatusChangedmethod on the instance being constructed.Applies a function to theonStatusChangedPropertyof the instance being constructed.onVisibilityChanged(EventHandler<WebEvent<Boolean>> handler) A builder method that invokes thesetOnVisibilityChangedmethod on the instance being constructed.Applies a function to theonVisibilityChangedPropertyof the instance being constructed.promptHandler(Callback<PromptData, String> handler) A builder method that invokes thesetPromptHandlermethod on the instance being constructed.Applies a function to thepromptHandlerPropertyof the instance being constructed.Applies a function to thetitlePropertyof the instance being constructed.A builder method that invokes thesetUserAgentmethod on the instance being constructed.Applies a function to theuserAgentPropertyof the instance being constructed.userDataDirectory(File value) A builder method that invokes thesetUserDataDirectorymethod on the instance being constructed.Applies a function to theuserDataDirectoryPropertyof the instance being constructed.userStyleSheetLocation(String value) A builder method that invokes thesetUserStyleSheetLocationmethod on the instance being constructed.Applies a function to theuserStyleSheetLocationPropertyof the instance being constructed.
-
Method Details
-
create
Returns an instance of theWebEngineBuilder.- Returns:
- an instance of the
WebEngineBuilder.
-
create
Accepts the constructor arguments ofWebEngine(String)and returns an instance ofWebEngineBuilder.- Returns:
- an instance of the
WebEngineBuilder.
-
build
-
apply
Applies a function to the WebEngine instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
confirmHandler
A builder method that invokes thesetConfirmHandlermethod on the instance being constructed.- Returns:
- builder instance
-
createPopupHandler
A builder method that invokes thesetCreatePopupHandlermethod on the instance being constructed.- Returns:
- builder instance
-
javaScriptEnabled
A builder method that invokes thesetJavaScriptEnabledmethod on the instance being constructed.- Returns:
- builder instance
-
onAlert
A builder method that invokes thesetOnAlertmethod on the instance being constructed.- Returns:
- builder instance
-
onError
A builder method that invokes thesetOnErrormethod on the instance being constructed.- Returns:
- builder instance
-
onResized
A builder method that invokes thesetOnResizedmethod on the instance being constructed.- Returns:
- builder instance
-
onStatusChanged
A builder method that invokes thesetOnStatusChangedmethod on the instance being constructed.- Returns:
- builder instance
-
onVisibilityChanged
A builder method that invokes thesetOnVisibilityChangedmethod on the instance being constructed.- Returns:
- builder instance
-
promptHandler
A builder method that invokes thesetPromptHandlermethod on the instance being constructed.- Returns:
- builder instance
-
userAgent
A builder method that invokes thesetUserAgentmethod on the instance being constructed.- Returns:
- builder instance
-
userDataDirectory
A builder method that invokes thesetUserDataDirectorymethod on the instance being constructed.- Returns:
- builder instance
-
userStyleSheetLocation
A builder method that invokes thesetUserStyleSheetLocationmethod on the instance being constructed.- Returns:
- builder instance
-
confirmHandlerPropertyApply
public WebEngineBuilder confirmHandlerPropertyApply(Consumer<ObjectProperty<Callback<String, Boolean>>> op) Applies a function to theconfirmHandlerPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.confirmHandlerProperty().bind(anotherProperty)) // Use shorthand form .confirmHandlerPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
createPopupHandlerPropertyApply
public WebEngineBuilder createPopupHandlerPropertyApply(Consumer<ObjectProperty<Callback<PopupFeatures, WebEngine>>> op) Applies a function to thecreatePopupHandlerPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.createPopupHandlerProperty().bind(anotherProperty)) // Use shorthand form .createPopupHandlerPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
documentPropertyApply
Applies a function to thedocumentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.documentProperty().bind(anotherProperty)) // Use shorthand form .documentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
javaScriptEnabledPropertyApply
Applies a function to thejavaScriptEnabledPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.javaScriptEnabledProperty().bind(anotherProperty)) // Use shorthand form .javaScriptEnabledPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
locationPropertyApply
Applies a function to thelocationPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.locationProperty().bind(anotherProperty)) // Use shorthand form .locationPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onAlertPropertyApply
public WebEngineBuilder onAlertPropertyApply(Consumer<ObjectProperty<EventHandler<WebEvent<String>>>> op) Applies a function to theonAlertPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onAlertProperty().bind(anotherProperty)) // Use shorthand form .onAlertPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onErrorPropertyApply
public WebEngineBuilder onErrorPropertyApply(Consumer<ObjectProperty<EventHandler<WebErrorEvent>>> op) Applies a function to theonErrorPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onErrorProperty().bind(anotherProperty)) // Use shorthand form .onErrorPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onResizedPropertyApply
public WebEngineBuilder onResizedPropertyApply(Consumer<ObjectProperty<EventHandler<WebEvent<Rectangle2D>>>> op) Applies a function to theonResizedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onResizedProperty().bind(anotherProperty)) // Use shorthand form .onResizedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onStatusChangedPropertyApply
public WebEngineBuilder onStatusChangedPropertyApply(Consumer<ObjectProperty<EventHandler<WebEvent<String>>>> op) Applies a function to theonStatusChangedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onStatusChangedProperty().bind(anotherProperty)) // Use shorthand form .onStatusChangedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onVisibilityChangedPropertyApply
public WebEngineBuilder onVisibilityChangedPropertyApply(Consumer<ObjectProperty<EventHandler<WebEvent<Boolean>>>> op) Applies a function to theonVisibilityChangedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onVisibilityChangedProperty().bind(anotherProperty)) // Use shorthand form .onVisibilityChangedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
promptHandlerPropertyApply
public WebEngineBuilder promptHandlerPropertyApply(Consumer<ObjectProperty<Callback<PromptData, String>>> op) Applies a function to thepromptHandlerPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.promptHandlerProperty().bind(anotherProperty)) // Use shorthand form .promptHandlerPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
titlePropertyApply
Applies a function to thetitlePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.titleProperty().bind(anotherProperty)) // Use shorthand form .titlePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
userAgentPropertyApply
Applies a function to theuserAgentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.userAgentProperty().bind(anotherProperty)) // Use shorthand form .userAgentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
userDataDirectoryPropertyApply
Applies a function to theuserDataDirectoryPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.userDataDirectoryProperty().bind(anotherProperty)) // Use shorthand form .userDataDirectoryPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
userStyleSheetLocationPropertyApply
Applies a function to theuserStyleSheetLocationPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.userStyleSheetLocationProperty().bind(anotherProperty)) // Use shorthand form .userStyleSheetLocationPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-