The
WebHistory class represents a session history associated with
a
WebEngine instance.
A single instance of
WebHistory for a particular web engine can be
obtained through the
WebEngine#getHistory() method.
The history is basically a list of entries. Each entry represents a visited page
and it provides access to relevant page info, such as URL, title, and the date
the page was last visited. Entries in the list are arranged in the order
in which the corresponding pages were visited from oldest to newest. The list can
be obtained by using the
getEntries() method.
The history and the corresponding list of entries change as
WebEngine navigates
across the web. The list may expand or shrink depending on browser actions. These
changes can be listened to by the
javafx.collections.ObservableList
API that the list exposes.
The index of the history entry associated with the currently visited page
is represented by the
currentIndexProperty. The current index can be
used to navigate to any entry in the history by using the
go(int) method.
The
maxSizeProperty() sets the maximum history size, which is the size of the
history list.
javafx.scene.web
back to summary
public final Class WebHistory.Entry
extends Object
- Class Inheritance
-
The Entry class represents a single entry in the session history.
An entry instance is associated with the visited page.
- Since
- JavaFX 2.2
Constructor Summary
| Access | Constructor and Description
|
|---|
| private |
|
Field Detail
| lastVisitedDate | back to summary
|
|---|
| private final ReadOnlyObjectWrapper<Date> lastVisitedDate
|
| url | back to summary
|
|---|
| private final URL url
|
Method Detail
| getLastVisitedDate | back to summary
|
|---|
| public Date getLastVisitedDate()
|
| getTitle | back to summary
|
|---|
| public String getTitle()
|
| getUrl | back to summary
|
|---|
| public String getUrl() Returns the URL of the page.
- Returns:String
the url of the page
|
| isPeer | back to summary
|
|---|
| pack-priv boolean isPeer(BackForwardList.Entry entry)
|
| lastVisitedDateProperty | back to summary
|
|---|
| public ReadOnlyObjectProperty<Date> lastVisitedDateProperty() Defines the java.util.Date the page was last visited.
- Returns:ReadOnlyObjectProperty<Date>
the lastVisitedDate property
|
| titleProperty | back to summary
|
|---|
| public ReadOnlyObjectProperty<String> titleProperty() Defines the title of the page.
- Returns:ReadOnlyObjectProperty<String>
the title property
|
| toString | back to summary
|
|---|
| public String toString() Overrides java.lang.Object.toString.
Doc from java.lang.Object.toString.
Returns a string representation of the object.
Satisfying this method's contract implies a non-null
result must be returned.
- Returns:String
a string representation of the object
- Annotations
- @Override
|