コード例 #1
0
ファイル: InfiniteList.java プロジェクト: juriad/artique
 /**
  * Tests whether all keys of {@link Label}s are known to {@link LabelsManager}.
  *
  * @param keys list of keys to be tested
  * @return whether all keys are known to {@link LabelsManager}
  */
 protected boolean hasAllLabels(Iterable<Key> keys) {
   boolean hasAll = true;
   for (Key key : keys) {
     if (Managers.LABELS_MANAGER.getLabelByKey(key) == null) {
       hasAll = false;
     }
   }
   return hasAll;
 }
コード例 #2
0
ファイル: InfiniteList.java プロジェクト: juriad/artique
  /**
   * Sets new value of row if the {@link UserItem} is already shown.
   *
   * @param value new value to show
   */
  public void setValue(final UserItem value) {
    if (!hasAllLabels(value.getLabels())) {
      Managers.LABELS_MANAGER.refresh(
          new AsyncCallback<Void>() {
            public void onSuccess(Void result) {
              doSetValue(value);
            }

            public void onFailure(Throwable caught) {}
          });
    } else {
      doSetValue(value);
    }
  }
コード例 #3
0
ファイル: InfiniteList.java プロジェクト: juriad/artique
  /** Makes all pending {@link UserItem}s below the last one show. */
  public void showTail() {
    Set<Key> labels = new HashSet<Key>();
    for (UserItem ui : tail) {
      labels.addAll(ui.getLabels());
    }
    if (!hasAllLabels(labels)) {
      Managers.LABELS_MANAGER.refresh(
          new AsyncCallback<Void>() {
            public void onSuccess(Void result) {
              addTail();
            }

            public void onFailure(Throwable caught) {}
          });
    } else {
      addTail();
    }
  }