Allows to change history state and url if provided. @param state the new state to use @param url the new url to use
(final Object state, final URL url)
| 318 | * @param url the new url to use |
| 319 | */ |
| 320 | public void replaceState(final Object state, final URL url) { |
| 321 | if (index_ >= 0 && index_ < entries_.size()) { |
| 322 | final HistoryEntry entry = entries_.get(index_); |
| 323 | |
| 324 | Page page = entry.getPage(); |
| 325 | if (page == null) { |
| 326 | page = window_.getEnclosedPage(); |
| 327 | } |
| 328 | |
| 329 | entry.setUrl(url, page); |
| 330 | entry.setState(state); |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * Allows to change history state and url if provided. |