WebView is a javafx.scene.Node that manages a
WebEngine and displays its content. The associated WebEngine
is created automatically at construction time and cannot be changed
afterwards. WebView handles mouse and some keyboard events, and
manages scrolling automatically, so there's no need to put it into a
ScrollPane.
WebView objects must be created and accessed solely from the
FX thread.
| Modifier and Type | Class and Description |
|---|---|
| private static class | WebView.
Super-lazy instantiation pattern from Bill Pugh. |
| Modifier and Type | Field and Description |
|---|---|
| private BooleanProperty | contextMenuEnabled
Specifies whether context menu is enabled. |
| private static final boolean | |
| private static final double | |
| private static final FontSmoothingType | |
| private static final double | |
| private static final double | |
| private static final double | |
| private static final double | |
| private static final Color | |
| private static final double | |
| private static final double | |
| private static final double | |
| private final WebEngine | |
| private DoubleProperty | fontScale
Specifies scale factor applied to font. |
| private ObjectProperty | fontSmoothingType
Specifies a requested font smoothing type : gray or LCD. |
| private final ReadOnlyDoubleWrapper | |
| private static final Map | |
| private volatile InputMethodClientImpl | |
| private DoubleProperty | |
| private DoubleProperty | |
| private LinkedList | |
| private DoubleProperty | |
| private DoubleProperty | |
| private final WebPage | |
| private ObjectProperty | pageFill
Specifies the background color of the web page. |
| private DoubleProperty | |
| private DoubleProperty | |
| private final TKPulseListener | stagePulseListener
The stage pulse listener registered with the toolkit. |
| private LinkedList | |
| private final ReadOnlyDoubleWrapper | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private DoubleProperty |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final BooleanProperty | |
| private boolean | |
| private BaseBounds | doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)
Hides javafx.
|
| private NGNode | |
| private void | doPickNodeLocal(PickRay pickRay, PickResultChooser result)
Hides javafx.
|
| private void | |
| private void | |
| public DoubleProperty | |
| public final ObjectProperty | |
| protected ObservableList | |
| public static List | Returns: theCssMetaDataHides javafx. Gets the |
| public List | getCssMetaData()
Overrides javafx. Implements javafx. This method should delegate to |
| public final WebEngine | |
| public final double | |
| public final FontSmoothingType | |
| private static TransferMode[] | |
| public final double | |
| private InputMethodClientImpl | |
| public final double | |
| public final double | |
| public final double | |
| public final double | |
| public final Color | |
| public final double | |
| public final double | |
| public final double | |
| private static int | |
| private static int | |
| public final double | |
| private void | |
| public ReadOnlyDoubleProperty | |
| public final boolean | |
| public boolean | isResizable()
Overrides javafx. Indicates whether this node is a type which can be resized by its parent. |
| private boolean | |
| public final double | Returns: the maximum height that this node should be resized to during layoutOverrides javafx. Called during layout to determine the maximum height for this node. |
| public DoubleProperty | |
| public final double | Returns: the maximum width that this node should be resized to during layoutOverrides javafx. Called during layout to determine the maximum width for this node. |
| public DoubleProperty | |
| public final double | Returns: the minimum height that this node should be resized to during layoutOverrides javafx. Called during layout to determine the minimum height for this node. |
| public DoubleProperty | |
| public final double | Returns: the minimum width that this node should be resized to during layoutOverrides javafx. Called during layout to determine the minimum width for this node. |
| public DoubleProperty | |
| public final ObjectProperty | |
| public final double | Returns: the preferred height that this node should be resized to during layoutOverrides javafx. Called during layout to determine the preferred height for this node. |
| public DoubleProperty | |
| public final double | Returns: the preferred width that this node should be resized to during layoutOverrides javafx. Called during layout to determine the preferred width for this node. |
| public DoubleProperty | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| public void | resize(double width, double height)
Overrides javafx. If the node is resizable, will set its layout bounds to the specified width and height. |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | setMaxSize(double
the maximum width maxWidth, double the maximum height maxHeight)Convenience method for setting maximum width and height. |
| public final void | |
| public final void | |
| public void | setMinSize(double
the minimum width minWidth, double the minimum height minHeight)Convenience method for setting minimum width and height. |
| public final void | |
| public final void | |
| public final void | |
| public void | setPrefSize(double
the preferred width prefWidth, double the preferred height prefHeight)Convenience method for setting preferred width and height. |
| public final void | |
| public final void | |
| public ReadOnlyDoubleProperty | |
| public final DoubleProperty | Returns: the zoom propertyThe current zoom factor applied to the entire page contents. |
| contextMenuEnabled | back to summary |
|---|---|
| private BooleanProperty contextMenuEnabled Specifies whether context menu is enabled.
| |
| DEFAULT_CONTEXT_MENU_ENABLED | back to summary |
|---|---|
| private static final boolean DEFAULT_CONTEXT_MENU_ENABLED | |
| DEFAULT_FONT_SCALE | back to summary |
|---|---|
| private static final double DEFAULT_FONT_SCALE | |
| DEFAULT_FONT_SMOOTHING_TYPE | back to summary |
|---|---|
| private static final FontSmoothingType DEFAULT_FONT_SMOOTHING_TYPE | |
| DEFAULT_MAX_HEIGHT | back to summary |
|---|---|
| private static final double DEFAULT_MAX_HEIGHT | |
| DEFAULT_MAX_WIDTH | back to summary |
|---|---|
| private static final double DEFAULT_MAX_WIDTH | |
| DEFAULT_MIN_HEIGHT | back to summary |
|---|---|
| private static final double DEFAULT_MIN_HEIGHT | |
| DEFAULT_MIN_WIDTH | back to summary |
|---|---|
| private static final double DEFAULT_MIN_WIDTH | |
| DEFAULT_PAGE_FILL | back to summary |
|---|---|
| private static final Color DEFAULT_PAGE_FILL | |
| DEFAULT_PREF_HEIGHT | back to summary |
|---|---|
| private static final double DEFAULT_PREF_HEIGHT | |
| DEFAULT_PREF_WIDTH | back to summary |
|---|---|
| private static final double DEFAULT_PREF_WIDTH | |
| DEFAULT_ZOOM | back to summary |
|---|---|
| private static final double DEFAULT_ZOOM | |
| engine | back to summary |
|---|---|
| private final WebEngine engine | |
| fontScale | back to summary |
|---|---|
| private DoubleProperty fontScale Specifies scale factor applied to font. This setting affects text content but not images and fixed size elements.
| |
| fontSmoothingType | back to summary |
|---|---|
| private ObjectProperty<FontSmoothingType> fontSmoothingType Specifies a requested font smoothing type : gray or LCD. The width of the bounding box is defined by the widest row. Note LCD mode doesn't apply in numerous cases, such as various compositing modes, where effects are applied and very large glyphs.
| |
| height | back to summary |
|---|---|
| private final ReadOnlyDoubleWrapper height | |
| ID_MAP | back to summary |
|---|---|
| private static final Map<Object, Integer> ID_MAP | |
| imClient | back to summary |
|---|---|
| private volatile InputMethodClientImpl imClient | |
| maxHeight | back to summary |
|---|---|
| private DoubleProperty maxHeight | |
| maxWidth | back to summary |
|---|---|
| private DoubleProperty maxWidth | |
| mimes | back to summary |
|---|---|
| private LinkedList<String> mimes | |
| minHeight | back to summary |
|---|---|
| private DoubleProperty minHeight | |
| minWidth | back to summary |
|---|---|
| private DoubleProperty minWidth | |
| page | back to summary |
|---|---|
| private final WebPage page | |
| pageFill | back to summary |
|---|---|
| private ObjectProperty<Color> pageFill Specifies the background color of the web page. With this property, the
| |
| prefHeight | back to summary |
|---|---|
| private DoubleProperty prefHeight | |
| prefWidth | back to summary |
|---|---|
| private DoubleProperty prefWidth | |
| stagePulseListener | back to summary |
|---|---|
| private final TKPulseListener stagePulseListener The stage pulse listener registered with the toolkit. This field guarantees that the listener will exist throughout the whole lifetime of the WebView node. This field is necessary because the toolkit references its stage pulse listeners weakly. | |
| values | back to summary |
|---|---|
| private LinkedList<String> values | |
| width | back to summary |
|---|---|
| private final ReadOnlyDoubleWrapper width | |
| WK_DND_ACTION_COPY | back to summary |
|---|---|
| private static final int WK_DND_ACTION_COPY | |
| WK_DND_ACTION_LINK | back to summary |
|---|---|
| private static final int WK_DND_ACTION_LINK | |
| WK_DND_ACTION_MOVE | back to summary |
|---|---|
| private static final int WK_DND_ACTION_MOVE | |
| WK_DND_ACTION_NONE | back to summary |
|---|---|
| private static final int WK_DND_ACTION_NONE | |
| zoom | back to summary |
|---|---|
| private DoubleProperty zoom | |
| WebView | back to summary |
|---|---|
| public WebView() Creates a | |
| contextMenuEnabledProperty | back to summary |
|---|---|
| public final BooleanProperty contextMenuEnabledProperty() | |
| doComputeContains | back to summary |
|---|---|
| private boolean doComputeContains(double localX, double localY) | |
| doComputeGeomBounds | back to summary |
|---|---|
| private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) | |
| doCreatePeer | back to summary |
|---|---|
| private NGNode doCreatePeer() | |
| doPickNodeLocal | back to summary |
|---|---|
| private void doPickNodeLocal(PickRay pickRay, PickResultChooser result) | |
| doTransformsChanged | back to summary |
|---|---|
| private void doTransformsChanged() | |
| doUpdatePeer | back to summary |
|---|---|
| private void doUpdatePeer() | |
| fontScaleProperty | back to summary |
|---|---|
| public DoubleProperty fontScaleProperty() | |
| fontSmoothingTypeProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| getChildren | back to summary |
|---|---|
| protected ObservableList Overrides javafx. Doc from javafx. Gets the list of children of this
See the class documentation for
If this Note to subclasses: if you override this method, you must return from your implementation the result of calling this super method. The actual list instance returned from any getChildren() implementation must be the list owned and managed by this Parent. The only typical purpose for overriding this method is to promote the method to be public.
| |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Gets the
| |
| getCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Implements javafx. Doc from javafx. This method should delegate to
| |
| getEngine | back to summary |
|---|---|
| public final WebEngine getEngine() Returns the
| |
| getFontScale | back to summary |
|---|---|
| public final double getFontScale() | |
| getFontSmoothingType | back to summary |
|---|---|
| public final FontSmoothingType getFontSmoothingType() | |
| getFXDndAction | back to summary |
|---|---|
| private static TransferMode[] getFXDndAction(int wkDndAction) | |
| getHeight | back to summary |
|---|---|
| public final double getHeight() | |
| getInputMethodClient | back to summary |
|---|---|
| private InputMethodClientImpl getInputMethodClient() | |
| getMaxHeight | back to summary |
|---|---|
| public final double getMaxHeight() | |
| getMaxWidth | back to summary |
|---|---|
| public final double getMaxWidth() | |
| getMinHeight | back to summary |
|---|---|
| public final double getMinHeight() | |
| getMinWidth | back to summary |
|---|---|
| public final double getMinWidth() | |
| getPageFill | back to summary |
|---|---|
| public final Color getPageFill() | |
| getPrefHeight | back to summary |
|---|---|
| public final double getPrefHeight() | |
| getPrefWidth | back to summary |
|---|---|
| public final double getPrefWidth() | |
| getWidth | back to summary |
|---|---|
| public final double getWidth() | |
| getWKDndAction | back to summary |
|---|---|
| private static int getWKDndAction(TransferMode... tms) | |
| getWKDndEventType | back to summary |
|---|---|
| private static int getWKDndEventType(EventType<T extends Event> et) | |
| getZoom | back to summary |
|---|---|
| public final double getZoom() | |
| handleStagePulse | back to summary |
|---|---|
| private void handleStagePulse() | |
| heightProperty | back to summary |
|---|---|
| public ReadOnlyDoubleProperty heightProperty() Height of this
| |
| isContextMenuEnabled | back to summary |
|---|---|
| public final boolean isContextMenuEnabled() | |
| isResizable | back to summary |
|---|---|
| public boolean isResizable() Overrides javafx. Doc from javafx. Indicates whether this node is a type which can be resized by its parent. If this method returns true, then the parent will resize the node (ideally within its size range) by calling node.resize(width,height) during the layout pass. All Regions, Controls, and WebView are resizable classes which depend on their parents resizing them during layout once all sizing and CSS styling information has been applied. If this method returns false, then the parent cannot resize it during layout (resize() is a no-op) and it should return its layoutBounds for minimum, preferred, and maximum sizes. Group, Text, and all Shapes are not resizable and hence depend on the application to establish their sizing by setting appropriate properties (e.g. width/height for Rectangle, text on Text, and so on). Non-resizable nodes may still be relocated during layout.
| |
| isTreeReallyVisible | back to summary |
|---|---|
| private boolean isTreeReallyVisible() | |
| maxHeight | back to summary |
|---|---|
| public final double maxHeight(double width) Overrides javafx. Called during layout to determine the maximum height for this node.
| |
| maxHeightProperty | back to summary |
|---|---|
| public DoubleProperty maxHeightProperty() Maximum height property.
| |
| maxWidth | back to summary |
|---|---|
| public final double maxWidth(double height) Overrides javafx. Called during layout to determine the maximum width for this node.
| |
| maxWidthProperty | back to summary |
|---|---|
| public DoubleProperty maxWidthProperty() Maximum width property.
| |
| minHeight | back to summary |
|---|---|
| public final double minHeight(double width) Overrides javafx. Called during layout to determine the minimum height for this node.
| |
| minHeightProperty | back to summary |
|---|---|
| public DoubleProperty minHeightProperty() Minimum height property.
| |
| minWidth | back to summary |
|---|---|
| public final double minWidth(double height) Overrides javafx. Called during layout to determine the minimum width for this node.
| |
| minWidthProperty | back to summary |
|---|---|
| public DoubleProperty minWidthProperty() Minimum width property.
| |
| pageFillProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| prefHeight | back to summary |
|---|---|
| public final double prefHeight(double width) Overrides javafx. Called during layout to determine the preferred height for this node.
| |
| prefHeightProperty | back to summary |
|---|---|
| public DoubleProperty prefHeightProperty() Preferred height property.
| |
| prefWidth | back to summary |
|---|---|
| public final double prefWidth(double height) Overrides javafx. Called during layout to determine the preferred width for this node.
| |
| prefWidthProperty | back to summary |
|---|---|
| public DoubleProperty prefWidthProperty() Preferred width property.
| |
| processInputMethodEvent | back to summary |
|---|---|
| private void processInputMethodEvent(InputMethodEvent ie) | |
| processKeyEvent | back to summary |
|---|---|
| private void processKeyEvent(KeyEvent ev) | |
| processMouseEvent | back to summary |
|---|---|
| private void processMouseEvent(MouseEvent ev) | |
| processScrollEvent | back to summary |
|---|---|
| private void processScrollEvent(ScrollEvent ev) | |
| registerEventHandlers | back to summary |
|---|---|
| private void registerEventHandlers() | |
| resize | back to summary |
|---|---|
| public void resize(double width, double height) Overrides javafx. Doc from javafx. If the node is resizable, will set its layout bounds to the specified width and height. If the node is not resizable, this method is a no-op. This method should generally only be called by parent nodes from their layoutChildren() methods. All Parent classes will automatically resize resizable children, so resizing done directly by the application will be overridden by the node's parent, unless the child is unmanaged. Parents are responsible for ensuring the width and height values fall within the resizable node's preferred range. The autosize() method may be used if the parent just needs to resize the node to its preferred size.
| |
| setContextMenuEnabled | back to summary |
|---|---|
| public final void setContextMenuEnabled(boolean value) | |
| setFontScale | back to summary |
|---|---|
| public final void setFontScale(double value) | |
| setFontSmoothingType | back to summary |
|---|---|
| public final void setFontSmoothingType(FontSmoothingType value) | |
| setMaxHeight | back to summary |
|---|---|
| public final void setMaxHeight(double value) | |
| setMaxSize | back to summary |
|---|---|
| public void setMaxSize(double maxWidth, double maxHeight) Convenience method for setting maximum width and height.
| |
| setMaxWidth | back to summary |
|---|---|
| public final void setMaxWidth(double value) | |
| setMinHeight | back to summary |
|---|---|
| public final void setMinHeight(double value) | |
| setMinSize | back to summary |
|---|---|
| public void setMinSize(double minWidth, double minHeight) Convenience method for setting minimum width and height.
| |
| setMinWidth | back to summary |
|---|---|
| public final void setMinWidth(double value) | |
| setPageFill | back to summary |
|---|---|
| public final void setPageFill(Color value) | |
| setPrefHeight | back to summary |
|---|---|
| public final void setPrefHeight(double value) | |
| setPrefSize | back to summary |
|---|---|
| public void setPrefSize(double prefWidth, double prefHeight) Convenience method for setting preferred width and height.
| |
| setPrefWidth | back to summary |
|---|---|
| public final void setPrefWidth(double value) | |
| setZoom | back to summary |
|---|---|
| public final void setZoom(double value) | |
| widthProperty | back to summary |
|---|---|
| public ReadOnlyDoubleProperty widthProperty() Width of this
| |
| zoomProperty | back to summary |
|---|---|
| public final DoubleProperty zoomProperty() The current zoom factor applied to the entire page contents.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final List | |
| private static final CssMetaData |
| Access | Constructor and Description |
|---|---|
| private |
| CONTEXT_MENU_ENABLED | back to summary |
|---|---|
| private static final CssMetaData<WebView, Boolean> CONTEXT_MENU_ENABLED | |
| FONT_SCALE | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> FONT_SCALE | |
| FONT_SMOOTHING_TYPE | back to summary |
|---|---|
| private static final CssMetaData<WebView, FontSmoothingType> FONT_SMOOTHING_TYPE | |
| MAX_HEIGHT | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> MAX_HEIGHT | |
| MAX_WIDTH | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> MAX_WIDTH | |
| MIN_HEIGHT | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> MIN_HEIGHT | |
| MIN_WIDTH | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> MIN_WIDTH | |
| PAGE_FILL | back to summary |
|---|---|
| private static final CssMetaData<WebView, Color> PAGE_FILL | |
| PREF_HEIGHT | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> PREF_HEIGHT | |
| PREF_WIDTH | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> PREF_WIDTH | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| ZOOM | back to summary |
|---|---|
| private static final CssMetaData<WebView, Number> ZOOM | |
| StyleableProperties | back to summary |
|---|---|
| private StyleableProperties() | |