java.lang.Object | |
↳ | com.google.gwt.user.client.History |
This class allows you to interact with the browser's history stack. Each "item" on the stack is represented by a single string, referred to as a "token". You can create new history items (which have a token associated with them when they are created), and you can programmatically force the current history to move back or forward.
In order to receive notification of user-directed changes to the current
history item, implement the ValueChangeHandler
interface and attach
it via addValueChangeHandler(ValueChangeHandler)
.
newItem(String)
to getToken()
/
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
, but most will be encoded in the user-visible URL. The following US-ASCII
characters are not encoded on any currently supported browser (but may be in
the future due to future browser changes):
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
use
addValueChangeHandler(ValueChangeHandler) instead
| |||||||||||
Adds a
ValueChangeEvent handler
to be informed of changes to the browser's history stack. | |||||||||||
Programmatic equivalent to the user pressing the browser's 'back' button.
| |||||||||||
Fire
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
events with the current history state. | |||||||||||
Programmatic equivalent to the user pressing the browser's 'forward'
button.
| |||||||||||
Gets the current history token.
| |||||||||||
Adds a new browser history entry.
| |||||||||||
Adds a new browser history entry.
| |||||||||||
This method is deprecated.
Use
fireCurrentHistoryState() instead.
| |||||||||||
Removes a history listener.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method is deprecated.
use addValueChangeHandler(ValueChangeHandler)
instead
Adds a listener to be informed of changes to the browser's history stack.
listener | the listener to be added |
---|
Adds a ValueChangeEvent
handler
to be informed of changes to the browser's history stack.
handler | the handler |
---|
Programmatic equivalent to the user pressing the browser's 'back' button. Note that this does not work correctly on Safari 2.
Fire
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
events with the current history state. This is most often called at the end
of an application's
onModuleLoad()
to inform
history handlers of the initial application state.
Programmatic equivalent to the user pressing the browser's 'forward' button.
Gets the current history token. The handler will not receive a
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
event for the initial token; requiring that an application request the
token explicitly on startup gives it an opportunity to run different
initialization code in the presence or absence of an initial token.
Adds a new browser history entry. Calling this method will cause
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
to be called as well if and only if issueEvent is true.
historyToken | the token to associate with the new history item |
---|---|
issueEvent | true if a
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
event should be issued
|
Adds a new browser history entry. Calling this method will cause
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
to be called as well.
historyToken | the token to associate with the new history item |
---|
This method is deprecated.
Use fireCurrentHistoryState()
instead.
Call all history handlers with the specified token. Note that this does not
change the history system's idea of the current state and is only kept for
backward compatibility. To fire history events for the initial state of the
application, instead call fireCurrentHistoryState()
from the
application onModuleLoad()
method.
historyToken | history token to fire events for |
---|
Removes a history listener.
listener | the listener to be removed |
---|