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

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

本文整理了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

/**
 * 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();
 }
}

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

public void refreshCurrentPlace()
{
  History.fireCurrentHistoryState();
}

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

@Override
public void fireCurrentHistoryState() {
 History.fireCurrentHistoryState();
}

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

public void refreshCurrentPlace()
{
  History.fireCurrentHistoryState();
}

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

public void fireCurrentHistoryState() {
 History.fireCurrentHistoryState();
}

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

public void fireCurrentHistoryState() {
 History.fireCurrentHistoryState();
}

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

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();
  }
}

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

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 );
  }
}

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

History.fireCurrentHistoryState();

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

/**
 * @see History#fireCurrentHistoryState()
 */
public static void fireCurrentHistoryState() {
 if (PushStateUtil.isPushStateActivated()) {
  maybeInitPushState();
  pushStateHistory.fireCurrentHistoryState();      
 }
 else {
  History.fireCurrentHistoryState();
 }
}

代码示例来源: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 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();
 }
}

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

/**
 * @see History#fireCurrentHistoryState()
 */
public static void fireCurrentHistoryState() {
 if (PushStateUtil.isPushStateActivated()) {
  maybeInitPushState();
  pushStateHistory.fireCurrentHistoryState();      
 }
 else {
  History.fireCurrentHistoryState();
 }
}

代码示例来源: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 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();
 }
}

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

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()));
  }
}

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

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();
}

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

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 );
  }
}

相关文章