/** * 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 if and only if issueEvent is true. * * @param historyToken history token to replace current top entry * @param issueEvent issueEvent true if a * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)} * event should be issued */ public static void replaceItem(String historyToken, boolean issueEvent) { token = historyToken; impl.replaceToken(encodeHistoryToken(historyToken)); if (issueEvent) { fireCurrentHistoryState(); } }
public void refreshCurrentPlace() { History.fireCurrentHistoryState(); }
@Override public void fireCurrentHistoryState() { History.fireCurrentHistoryState(); }
public void refreshCurrentPlace() { History.fireCurrentHistoryState(); }
public void fireCurrentHistoryState() { History.fireCurrentHistoryState(); }
public void fireCurrentHistoryState() { History.fireCurrentHistoryState(); }
private void startHistoryManagement() { // Manage history change/navigation. // TODO: figure out how this fits in with Activities and Places. // TODO: probably pull this into a separate component. History.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> event) { String historyToken = event.getValue(); // Find the module matching the history token. if (historyToken.startsWith("module-")) { String moduleId = historyToken.substring("module-".length()); for (MavenProjectDTO module : mdp.getList()) { if (moduleId.equals(module.getId())) { moduleInfoPickerPresenter.selectModule(module); // Show the module info tab. mainPanel.selectModuleInfo(); break; } } } } }); // Navigate to initial history state (as determined by the URL). History.fireCurrentHistoryState(); } }
private void update(final String pageParams) { if ( pageMode == null ) { // FIXME seriously revisit exception handling in the search UI throw new RuntimeException( "Cannot set history" ); } final StringBuilder buf = new StringBuilder( pageMode.getToken() ); if ( pageParams != null && pageParams.length() > 0 ) { // Use the standard ? to signal the start of the query parameters buf.append( pageParams ); } String newPageParams = buf.toString(); String currentPageParams = getCurrentPageParams(); if ( currentPageParams.equals( newPageParams ) ) { History.fireCurrentHistoryState(); } else { History.newItem( newPageParams ); } }
/** * @see History#fireCurrentHistoryState() */ public static void fireCurrentHistoryState() { if (PushStateUtil.isPushStateActivated()) { maybeInitPushState(); pushStateHistory.fireCurrentHistoryState(); } else { History.fireCurrentHistoryState(); } }
/** * 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 if and only if issueEvent is true. * * @param historyToken history token to replace current top entry * @param issueEvent issueEvent true if a * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)} * event should be issued */ public static void replaceItem(String historyToken, boolean issueEvent) { token = historyToken; impl.replaceToken(encodeHistoryToken(historyToken)); if (issueEvent) { fireCurrentHistoryState(); } }
/** * @see History#fireCurrentHistoryState() */ public static void fireCurrentHistoryState() { if (PushStateUtil.isPushStateActivated()) { maybeInitPushState(); pushStateHistory.fireCurrentHistoryState(); } else { History.fireCurrentHistoryState(); } }
/** * 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 if and only if issueEvent is true. * * @param historyToken history token to replace current top entry * @param issueEvent issueEvent true if a * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)} * event should be issued */ public static void replaceItem(String historyToken, boolean issueEvent) { token = historyToken; impl.replaceToken(encodeHistoryToken(historyToken)); if (issueEvent) { fireCurrentHistoryState(); } }
private void fireInitialPage() { if (History.getToken().length() != 0) { Log.debug("HistoryManager: firing initial placed based on intial token: " + History.getToken()); History.fireCurrentHistoryState(); } else { eventBus.fireEvent(new NavigationEvent( NavigationHandler.NAVIGATION_REQUESTED, new DashboardPlace())); } }
private void addMain() { mainSlot = RootPanel.get( MAIN_CONTAINER ); if ( mainSlot == null ) { Window.alert( "Missing main body element" ); return; } mainPanel = new StemCellSearchPageWrapper(); mainPanel.add( new StemCellPage() ); mainPanel.setStyleName("resultsPageOuter"); mainSlot.add( mainPanel ); // This makes StemCellPage take over History.fireCurrentHistoryState(); }
public void updateCurrentRequest(final StemCellSearchRequest request, boolean redraw) { // TODO validate request if(redraw) { if(currentPageParamString.equals( request.toUrlParams() ) ) { History.fireCurrentHistoryState(); } else { History.newItem( currentPageMode.getToken() + request.toUrlParams() ); } } else { // Need to still update internal state and add a history item // just don't fire an event setInternalRequestState( request.toUrlParams() ); History.newItem( currentPageMode.getToken() + request.toUrlParams(), false ); } }