Beispiel #1
0
  /**
   * Update the content panel with the new history
   *
   * @param historyTokens the history tokens
   */
  public void update(final List<String> historyTokens) {
    HistoryResolver foundResolver = null;
    for (final HistoryResolver resolver : resolvers) {
      if (historyTokens.get(0).equals(resolver.getHistoryToken())) {
        currHistoryPath = historyTokens;
        foundResolver = resolver;
        break;
      }
    }

    if (foundResolver != null) {
      update(historyTokens, foundResolver);
    } else {
      HistoryUtils.newHistory(Theme.RESOLVER, "Error404.html");
    }
  }
Beispiel #2
0
 @Override
 public void resolve(List<String> historyTokens, AsyncCallback<Widget> callback) {
   if (historyTokens.size() >= 1) {
     StringBuilder sb = new StringBuilder();
     boolean first = true;
     for (String token : historyTokens) {
       if (first) {
         first = false;
       } else {
         sb.append("/");
       }
       sb.append(token);
     }
     Theme theme = new Theme(sb.toString());
     callback.onSuccess(theme);
   } else {
     HistoryUtils.newHistory(Theme.RESOLVER);
     callback.onSuccess(null);
   }
 }