public final class HistoryX extends History
Note: with Internet Explorer, manual modification of the history token from within the address bar goes unrecorded in the stack (IE 8). As a result, a subsequent press of the back button takes you farther back than expected.
Constructor and Description |
---|
HistoryX(boolean _isFragmentShared,
EventBus _bus)
Constructs a permanent instance of HistoryX.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addHandler(ValueChangeHandler<String> handler)
Registers a handler to receive change events fired from this history stack.
|
HandlerRegistration |
addPreviewHandler(ValueChangeHandler<String> handler)
Registers a handler to receive change events fired from the preview source.
|
static HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<String> handler)
Throws UnsupportedOperationException.
|
EventBus |
bus()
The bus through which events are fired.
|
String |
clearSwitchValue(String name)
Removes the switch from the history token and returns its value.
|
String |
getSwitchValue(String name)
Returns the value of a switch, or null if the switch has no value.
|
boolean |
isFragmentShared()
Answers whether the URL fragment of the browser window may be used for purposes
other than storing the history token.
|
Object |
previewSource()
The source of all preview events.
|
void |
replace()
Schedules the construction of a new token to replace the current item in the
browser's history stack, as opposed to adding a new one.
|
String |
setSwitchValue(String name,
String value)
Sets the value of a switch and returns the old value.
|
Map<String,String> |
switchMap()
The map of switches in the current history token, indexed by switch name.
|
addHistoryListener, back, encodeHistoryToken, fireCurrentHistoryState, forward, getToken, newItem, newItem, onHistoryChanged, removeHistoryListener, replaceItem, replaceItem
public HistoryX(boolean _isFragmentShared, EventBus _bus)
isFragmentShared()
,
bus()
public HandlerRegistration addHandler(ValueChangeHandler<String> handler)
And for token changes:
public HandlerRegistration addPreviewHandler(ValueChangeHandler<String> handler)
addHandler(ValueChangeHandler)
public Object previewSource()
public String getSwitchValue(String name)
Switch.get()
public String clearSwitchValue(String name)
Switch.clear()
public String setSwitchValue(String name, String value)
Switch.set(String)
public boolean isFragmentShared()
id
attributes), then set this true in the constructor in order to suppress malformed
switch alerts.public void replace()
Window.Location.replace(String)
public Map<String,String> switchMap()
public static HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler)