@NotNull
        @Override
        public String getValue(@NotNull final RESTCategoryCollectionItemV1 object) {
          if (getOriginalEntity() != null) {
            if (ComponentCategoryV1.containsTag(object.getItem(), getOriginalEntity().getId())) {
              return PressGangCCMSUI.INSTANCE.Remove();
            } else {
              return PressGangCCMSUI.INSTANCE.Add();
            }
          }

          return PressGangCCMSUI.INSTANCE.NoAction();
        }
  public TopicFilteredResultsView() {
    super(
        PressGangCCMSUI.INSTANCE.PressGangCCMS(),
        PressGangCCMSUI.INSTANCE.SearchResults(),
        PressGangCCMSUI.INSTANCE.CreateTopic());

    getResults().addColumn(idColumn, PressGangCCMSUI.INSTANCE.TopicID());
    getResults().addColumn(titleColumn, PressGangCCMSUI.INSTANCE.TopicTitle());

    /* Unlike every other results view, the topic results don't have a search button */
    this.getEntitySearch().removeFromParent();

    addActionButton(bulkImport);
    addActionButton(bulkOverwrite);
    addActionButton(atomFeed);
  }
  public TagCategoriesView() {
    super(PressGangCCMSUI.INSTANCE.PressGangCCMS(), PressGangCCMSUI.INSTANCE.TagCategories());

    getPossibleChildrenResults().addColumn(idColumn, PressGangCCMSUI.INSTANCE.CategoryID());
    getPossibleChildrenResults().addColumn(nameColumn, PressGangCCMSUI.INSTANCE.CategoryName());
    getPossibleChildrenResults().addColumn(buttonColumn, PressGangCCMSUI.INSTANCE.AddRemove());

    idColumn.setSortable(true);
    nameColumn.setSortable(true);
    buttonColumn.setSortable(true);

    /*
       Allow the table to be sorted.
    */
    @NotNull
    final ColumnSortEvent.AsyncHandler columnSortHandler =
        new ColumnSortEvent.AsyncHandler(getPossibleChildrenResults());
    getPossibleChildrenResults().addColumnSortHandler(columnSortHandler);

    getExistingChildrenResults().addColumn(tagIdColumn, PressGangCCMSUI.INSTANCE.TagID());
    getExistingChildrenResults().addColumn(tagNameColumn, PressGangCCMSUI.INSTANCE.TagName());
    getExistingChildrenResults().addColumn(tagUpButtonColumn, PressGangCCMSUI.INSTANCE.Up());
    getExistingChildrenResults().addColumn(tagDownButtonColumn, PressGangCCMSUI.INSTANCE.Down());
  }
@Dependent
public class TopicFilteredResultsView extends BaseFilteredResultsView<RESTTopicCollectionItemV1>
    implements TopicFilteredResultsPresenter.Display {

  private final PushButton bulkImport =
      UIUtilities.createPushButton(PressGangCCMSUI.INSTANCE.BulkTopicImport());
  private final PushButton bulkOverwrite =
      UIUtilities.createPushButton(PressGangCCMSUI.INSTANCE.BulkTopicOverwrite());
  private final PushButton atomFeed =
      UIUtilities.createPushButton(PressGangCCMSUI.INSTANCE.ATOMFeed(), false, true);

  @NotNull
  private final TextColumn<RESTTopicCollectionItemV1> idColumn =
      new TextColumn<RESTTopicCollectionItemV1>() {
        @Override
        @NotNull
        public String getValue(@Nullable final RESTTopicCollectionItemV1 object) {
          if (object == null) {
            return null + "";
          }
          return object.getItem().getId().toString();
        }
      };

  @NotNull
  private final TextColumn<RESTTopicCollectionItemV1> titleColumn =
      new TextColumn<RESTTopicCollectionItemV1>() {
        @Override
        @NotNull
        public String getValue(@Nullable final RESTTopicCollectionItemV1 object) {
          if (object == null) {
            return null + "";
          }
          return object.getItem().getTitle();
        }
      };

  public TopicFilteredResultsView() {
    super(
        PressGangCCMSUI.INSTANCE.PressGangCCMS(),
        PressGangCCMSUI.INSTANCE.SearchResults(),
        PressGangCCMSUI.INSTANCE.CreateTopic());

    getResults().addColumn(idColumn, PressGangCCMSUI.INSTANCE.TopicID());
    getResults().addColumn(titleColumn, PressGangCCMSUI.INSTANCE.TopicTitle());

    /* Unlike every other results view, the topic results don't have a search button */
    this.getEntitySearch().removeFromParent();

    addActionButton(bulkImport);
    addActionButton(bulkOverwrite);
    addActionButton(atomFeed);
  }

  @NotNull
  @Override
  public PushButton getBulkImport() {
    return bulkImport;
  }

  @NotNull
  @Override
  public PushButton getBulkOverwrite() {
    return bulkOverwrite;
  }

  @NotNull
  @Override
  public PushButton getAtomFeed() {
    return atomFeed;
  }
}
 @NotNull
 @Override
 public String getValue(final RESTTagInCategoryCollectionItemV1 object) {
   return PressGangCCMSUI.INSTANCE.Down();
 }