public class HistoryImpl extends Object implements HasValueChangeHandlers<String>
History
. User classes should not use this
class directly.
This base version uses the HTML5 standard window.onhashchange event to determine when the URL hash identifier changes.
Constructor and Description |
---|
HistoryImpl() |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<String> handler)
Adds a
ValueChangeEvent handler to be informed of changes to the
browser's history stack. |
protected String |
decodeFragment(String encodedFragment) |
void |
dispose() |
String |
encodeFragment(String fragment) |
void |
fireEvent(GwtEvent<?> event)
Fires the given event to the handlers listening to the event's type.
|
void |
fireHistoryChangedImpl(String newToken)
Fires the
ValueChangeEvent to all handlers with the given tokens. |
HandlerManager |
getHandlers() |
static String |
getToken() |
boolean |
init() |
protected void |
nativeUpdate(String historyToken)
The standard updateHash implementation assigns to location.hash() with an
encoded history token.
|
protected void |
nativeUpdateOnEvent(String historyToken) |
void |
newItem(String historyToken,
boolean issueEvent) |
void |
newItemOnEvent(String historyToken) |
protected static void |
setToken(String token) |
static void |
setUpdateHashOnIE6(boolean updateHash)
Deprecated.
This is no longer necessary, as the underlying performance
problem has been solved. It is now a no-op.
|
public static String getToken()
@Deprecated public static void setUpdateHashOnIE6(boolean updateHash)
protected static void setToken(String token)
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler)
ValueChangeEvent
handler to be informed of changes to the
browser's history stack.addValueChangeHandler
in interface HasValueChangeHandlers<String>
handler
- the handlerpublic void dispose()
public void fireEvent(GwtEvent<?> event)
HasHandlers
Any exceptions thrown by handlers will be bundled into a
UmbrellaException
and then re-thrown after all handlers have
completed. An exception thrown by a handler will not prevent other handlers
from executing.
fireEvent
in interface HasHandlers
event
- the eventpublic void fireHistoryChangedImpl(String newToken)
ValueChangeEvent
to all handlers with the given tokens.public HandlerManager getHandlers()
public boolean init()
public final void newItem(String historyToken, boolean issueEvent)
public final void newItemOnEvent(String historyToken)
protected void nativeUpdate(String historyToken)
protected void nativeUpdateOnEvent(String historyToken)
Copyright © 2018. All rights reserved.