本文整理了Java中com.google.gwt.user.client.History.replaceItem()
方法的一些代码示例,展示了History.replaceItem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。History.replaceItem()
方法的具体详情如下:
包路径:com.google.gwt.user.client.History
类名称:History
方法名:replaceItem
[英]Replace the current history token on top of the browsers history stack.
Note: This method has problems. The URL is updated with window.location.replace, this unfortunately has side effects when using the deprecated iframe linker (ie. "std" linker). Make sure you are using the cross site iframe linker when using this method in your code.
Calling this method will cause ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)to be called as well.
[中]替换浏览器历史堆栈顶部的当前历史标记。
注意:此方法存在问题。URL将随窗口一起更新。地方不幸的是,这在使用不推荐使用的iframe链接器(即“std”链接器)时会产生副作用。在代码中使用此方法时,请确保正在使用跨站点iframe链接器。
调用此方法也会导致调用ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Replace the current history token on top of the browsers history stack.
*
* <p>Note: This method has problems. The URL is updated with window.location.replace,
* this unfortunately has side effects when using the deprecated iframe linker
* (ie. "std" linker). Make sure you are using the cross site iframe linker when using
* this method in your code.
*
* <p>Calling this method will cause
* {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
* to be called as well.
*
* @param historyToken history token to replace current top entry
*/
public static void replaceItem(String historyToken) {
replaceItem(historyToken, true);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Replace the current history token on top of the browsers history stack.
*
* <p>Note: This method has problems. The URL is updated with window.location.replace,
* this unfortunately has side effects when using the deprecated iframe linker
* (ie. "std" linker). Make sure you are using the cross site iframe linker when using
* this method in your code.
*
* <p>Calling this method will cause
* {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
* to be called as well.
*
* @param historyToken history token to replace current top entry
*/
public static void replaceItem(String historyToken) {
replaceItem(historyToken, true);
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Replace the current history token on top of the browsers history stack.
*
* <p>Note: This method has problems. The URL is updated with window.location.replace,
* this unfortunately has side effects when using the deprecated iframe linker
* (ie. "std" linker). Make sure you are using the cross site iframe linker when using
* this method in your code.
*
* <p>Calling this method will cause
* {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
* to be called as well.
*
* @param historyToken history token to replace current top entry
*/
public static void replaceItem(String historyToken) {
replaceItem(historyToken, true);
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Update the fragment parameters of the current visible place. This will cause a NEW item to be added to the
* browser history so the back button will take you back to the previous fragment parameters on the same place.
* @param params key value pairs containing the key and the value of the parameters. Valid keys are defined in
* {@link FragmentParams}
* @param newItem true to insert new item into History, false to simply replace current URL without adding
* to history
*/
public void setFragmentParameters(Map<String, String> params, boolean newItem) {
PlaceRequest request = new PlaceRequest.Builder().nameToken(
getCurrentPlaceRequest().getNameToken()).with(params).build();
if (newItem) {
History.newItem(buildHistoryToken(request), false);
} else {
History.replaceItem(buildHistoryToken(request), false);
}
}
内容来源于网络,如有侵权,请联系作者删除!