Spec-Zone .ru
спецификации, руководства, описания, API
|
public final class WebHistory
extends java.lang.Object
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. 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 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.Type | Property and Description |
---|---|
ReadOnlyIntegerProperty |
currentIndex
Defines the index of the current
Entry in the history. |
IntegerProperty |
maxSize
Defines the maximum size of the history list.
|
Modifier and Type | Class and Description |
---|---|
class |
WebHistory.Entry
The
Entry class represents a single entry in the session history. |
Modifier and Type | Method and Description |
---|---|
ReadOnlyIntegerProperty |
currentIndexProperty()
Defines the index of the current
Entry in the history. |
int |
getCurrentIndex()
Gets the value of the property currentIndex.
|
ObservableList<WebHistory.Entry> |
getEntries()
Returns an unmodifiable observable list of all entries in the history.
|
int |
getMaxSize()
Gets the value of the property maxSize.
|
void |
go(int offset)
Navigates the web engine to the URL defined by the
Entry object
within the specified position relative to the current entry. |
IntegerProperty |
maxSizeProperty()
Defines the maximum size of the history list.
|
void |
setMaxSize(int value)
Sets the value of the property maxSize.
|
public ReadOnlyIntegerProperty currentIndexProperty
Entry
in the history.
The current entry is the entry associated with the currently loaded page.
The index belongs to the range of (index >= 0 && index < getEntries().size())getCurrentIndex()
public IntegerProperty maxSizeProperty
The value specified for this property can not be negative, otherwise
IllegalArgumentException
is thrown.
getMaxSize()
,
setMaxSize(int)
public ReadOnlyIntegerProperty currentIndexProperty()
Entry
in the history.
The current entry is the entry associated with the currently loaded page.
The index belongs to the range of (index >= 0 && index < getEntries().size())getCurrentIndex()
public int getCurrentIndex()
Entry
in the history.
The current entry is the entry associated with the currently loaded page.
The index belongs to the range of (index >= 0 && index < getEntries().size())public IntegerProperty maxSizeProperty()
The value specified for this property can not be negative, otherwise
IllegalArgumentException
is thrown.
getMaxSize()
,
setMaxSize(int)
public void setMaxSize(int value)
The value specified for this property can not be negative, otherwise
IllegalArgumentException
is thrown.
public int getMaxSize()
The value specified for this property can not be negative, otherwise
IllegalArgumentException
is thrown.
public ObservableList<WebHistory.Entry> getEntries()
public void go(int offset) throws java.lang.IndexOutOfBoundsException
Entry
object
within the specified position relative to the current entry. A negative
offset
value specifies the position left to the current entry,
and a positive offset
value specifies the position right to the
current entry. For example, -1 points to the previous entry, and 1 points
to the next entry.
The zero offset
value is silently ignored (no-op).
The effective entry position should belong to the rage of [0..size-1].
Otherwise, IndexOutOfBoundsException
is thrown.offset
- a negative value specifies a position relative
to the left from the current entry, a positive value specifies a
position relative to the right from the current entry, zero value
causes no effectjava.lang.IndexOutOfBoundsException
- if the effective entry position is out
of rangeCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to