com.google.gwt.user.client.History.fireCurrentHistoryState()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中com.google.gwt.user.client.History.fireCurrentHistoryState()方法的一些代码示例,展示了History.fireCurrentHistoryState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。History.fireCurrentHistoryState()方法的具体详情如下:
包路径:com.google.gwt.user.client.History
类名称:History
方法名:fireCurrentHistoryState

History.fireCurrentHistoryState介绍

[英]Fire ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)events with the current history state. This is most often called at the end of an application's com.google.gwt.core.client.EntryPoint#onModuleLoad() to inform history handlers of the initial application state.
[中]将ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)事件与当前历史状态一起激发。这通常在应用程序的com结束时调用。谷歌。gwt。果心客户EntryPoint#onModuleLoad()通知历史处理程序初始应用程序状态。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

  1. /**
  2. * Replace the current history token on top of the browsers history stack.
  3. *
  4. * <p>Note: This method has problems. The URL is updated with window.location.replace,
  5. * this unfortunately has side effects when using the deprecated iframe linker
  6. * (ie. "std" linker). Make sure you are using the cross site iframe linker when using
  7. * this method in your code.
  8. *
  9. * <p>Calling this method will cause
  10. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  11. * to be called as well if and only if issueEvent is true.
  12. *
  13. * @param historyToken history token to replace current top entry
  14. * @param issueEvent issueEvent true if a
  15. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  16. * event should be issued
  17. */
  18. public static void replaceItem(String historyToken, boolean issueEvent) {
  19. token = historyToken;
  20. impl.replaceToken(encodeHistoryToken(historyToken));
  21. if (issueEvent) {
  22. fireCurrentHistoryState();
  23. }
  24. }

代码示例来源:origin: ltearno/hexa.tools

  1. public void refreshCurrentPlace()
  2. {
  3. History.fireCurrentHistoryState();
  4. }

代码示例来源:origin: stephenh/tessell

  1. @Override
  2. public void fireCurrentHistoryState() {
  3. History.fireCurrentHistoryState();
  4. }

代码示例来源:origin: fr.lteconsulting/hexa.core

  1. public void refreshCurrentPlace()
  2. {
  3. History.fireCurrentHistoryState();
  4. }

代码示例来源:origin: mvp4g/mvp4g

  1. public void fireCurrentHistoryState() {
  2. History.fireCurrentHistoryState();
  3. }

代码示例来源:origin: com.googlecode.mvp4g/mvp4g

  1. public void fireCurrentHistoryState() {
  2. History.fireCurrentHistoryState();
  3. }

代码示例来源:origin: org.jvnet.hudson.main/maven3-plugin

  1. private void startHistoryManagement() {
  2. // Manage history change/navigation.
  3. // TODO: figure out how this fits in with Activities and Places.
  4. // TODO: probably pull this into a separate component.
  5. History.addValueChangeHandler(new ValueChangeHandler<String>()
  6. {
  7. public void onValueChange(ValueChangeEvent<String> event) {
  8. String historyToken = event.getValue();
  9. // Find the module matching the history token.
  10. if (historyToken.startsWith("module-")) {
  11. String moduleId = historyToken.substring("module-".length());
  12. for (MavenProjectDTO module : mdp.getList()) {
  13. if (moduleId.equals(module.getId())) {
  14. moduleInfoPickerPresenter.selectModule(module);
  15. // Show the module info tab.
  16. mainPanel.selectModuleInfo();
  17. break;
  18. }
  19. }
  20. }
  21. }
  22. });
  23. // Navigate to initial history state (as determined by the URL).
  24. History.fireCurrentHistoryState();
  25. }
  26. }

代码示例来源:origin: org.eagle-i/eagle-i-search-gwt

  1. private void update(final String pageParams) {
  2. if ( pageMode == null ) {
  3. // FIXME seriously revisit exception handling in the search UI
  4. throw new RuntimeException( "Cannot set history" );
  5. }
  6. final StringBuilder buf = new StringBuilder( pageMode.getToken() );
  7. if ( pageParams != null && pageParams.length() > 0 ) {
  8. // Use the standard ? to signal the start of the query parameters
  9. buf.append( pageParams );
  10. }
  11. String newPageParams = buf.toString();
  12. String currentPageParams = getCurrentPageParams();
  13. if ( currentPageParams.equals( newPageParams ) ) {
  14. History.fireCurrentHistoryState();
  15. } else {
  16. History.newItem( newPageParams );
  17. }
  18. }

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

  1. History.fireCurrentHistoryState();

代码示例来源:origin: errai/errai

  1. /**
  2. * @see History#fireCurrentHistoryState()
  3. */
  4. public static void fireCurrentHistoryState() {
  5. if (PushStateUtil.isPushStateActivated()) {
  6. maybeInitPushState();
  7. pushStateHistory.fireCurrentHistoryState();
  8. }
  9. else {
  10. History.fireCurrentHistoryState();
  11. }
  12. }

代码示例来源:origin: net.wetheinter/gwt-user

  1. /**
  2. * Replace the current history token on top of the browsers history stack.
  3. *
  4. * <p>Note: This method has problems. The URL is updated with window.location.replace,
  5. * this unfortunately has side effects when using the deprecated iframe linker
  6. * (ie. "std" linker). Make sure you are using the cross site iframe linker when using
  7. * this method in your code.
  8. *
  9. * <p>Calling this method will cause
  10. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  11. * to be called as well if and only if issueEvent is true.
  12. *
  13. * @param historyToken history token to replace current top entry
  14. * @param issueEvent issueEvent true if a
  15. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  16. * event should be issued
  17. */
  18. public static void replaceItem(String historyToken, boolean issueEvent) {
  19. token = historyToken;
  20. impl.replaceToken(encodeHistoryToken(historyToken));
  21. if (issueEvent) {
  22. fireCurrentHistoryState();
  23. }
  24. }

代码示例来源:origin: org.jboss.errai/errai-navigation

  1. /**
  2. * @see History#fireCurrentHistoryState()
  3. */
  4. public static void fireCurrentHistoryState() {
  5. if (PushStateUtil.isPushStateActivated()) {
  6. maybeInitPushState();
  7. pushStateHistory.fireCurrentHistoryState();
  8. }
  9. else {
  10. History.fireCurrentHistoryState();
  11. }
  12. }

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

  1. /**
  2. * Replace the current history token on top of the browsers history stack.
  3. *
  4. * <p>Note: This method has problems. The URL is updated with window.location.replace,
  5. * this unfortunately has side effects when using the deprecated iframe linker
  6. * (ie. "std" linker). Make sure you are using the cross site iframe linker when using
  7. * this method in your code.
  8. *
  9. * <p>Calling this method will cause
  10. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  11. * to be called as well if and only if issueEvent is true.
  12. *
  13. * @param historyToken history token to replace current top entry
  14. * @param issueEvent issueEvent true if a
  15. * {@link ValueChangeHandler#onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)}
  16. * event should be issued
  17. */
  18. public static void replaceItem(String historyToken, boolean issueEvent) {
  19. token = historyToken;
  20. impl.replaceToken(encodeHistoryToken(historyToken));
  21. if (issueEvent) {
  22. fireCurrentHistoryState();
  23. }
  24. }

代码示例来源:origin: bedatadriven/activityinfo

  1. private void fireInitialPage() {
  2. if (History.getToken().length() != 0) {
  3. Log.debug("HistoryManager: firing initial placed based on intial token: "
  4. + History.getToken());
  5. History.fireCurrentHistoryState();
  6. } else {
  7. eventBus.fireEvent(new NavigationEvent(
  8. NavigationHandler.NAVIGATION_REQUESTED, new DashboardPlace()));
  9. }
  10. }

代码示例来源:origin: org.eagle-i/eagle-i-search-gwt

  1. private void addMain() {
  2. mainSlot = RootPanel.get( MAIN_CONTAINER );
  3. if ( mainSlot == null ) {
  4. Window.alert( "Missing main body element" );
  5. return;
  6. }
  7. mainPanel = new StemCellSearchPageWrapper();
  8. mainPanel.add( new StemCellPage() );
  9. mainPanel.setStyleName("resultsPageOuter");
  10. mainSlot.add( mainPanel );
  11. // This makes StemCellPage take over
  12. History.fireCurrentHistoryState();
  13. }

代码示例来源:origin: org.eagle-i/eagle-i-search-gwt

  1. public void updateCurrentRequest(final StemCellSearchRequest request, boolean redraw) {
  2. // TODO validate request
  3. if(redraw) {
  4. if(currentPageParamString.equals( request.toUrlParams() ) ) {
  5. History.fireCurrentHistoryState();
  6. } else {
  7. History.newItem( currentPageMode.getToken() + request.toUrlParams() );
  8. }
  9. } else {
  10. // Need to still update internal state and add a history item
  11. // just don't fire an event
  12. setInternalRequestState( request.toUrlParams() );
  13. History.newItem( currentPageMode.getToken() + request.toUrlParams(), false );
  14. }
  15. }

相关文章