// Override
 public String getTreeTitle(NetworkTree tree) {
   final SearchResult result = ((SearchItemTree) tree).getSearchResult();
   if (result != null) {
     return result.Summary;
   }
   return tree.getName();
 }
Exemplo n.º 2
0
 @Override
 public void run(NetworkTree tree) {
   final Intent intent = new Intent(myActivity, AddCustomCatalogActivity.class);
   Util.intentByLink(intent, tree.getLink());
   intent.setAction(Util.EDIT_CATALOG_ACTION);
   myActivity.startActivity(intent);
 }
Exemplo n.º 3
0
  @Override
  public boolean isVisible(NetworkTree tree) {
    if (!(tree instanceof NetworkCatalogRootTree)) {
      return false;
    }

    final NetworkAuthenticationManager mgr = tree.getLink().authenticationManager();
    return mgr != null && !mgr.mayBeAuthorised(false);
  }
Exemplo n.º 4
0
 private void doOpenTree(NetworkTree tree) {
   if (myActivity instanceof NetworkLibraryActivity) {
     ((NetworkLibraryActivity) myActivity).openTree(tree);
   } else {
     OrientationUtil.startActivity(
         myActivity,
         new Intent(myActivity.getApplicationContext(), NetworkLibrarySecondaryActivity.class)
             .putExtra(NetworkLibraryActivity.TREE_KEY_KEY, tree.getUniqueKey()));
   }
 }
Exemplo n.º 5
0
  @Override
  public boolean isVisible(NetworkTree tree) {
    if (!(tree instanceof NetworkCatalogRootTree)) {
      return false;
    }

    final INetworkLink link = tree.getLink();
    final NetworkAuthenticationManager mgr = link.authenticationManager();
    return mgr != null
        && !mgr.mayBeAuthorised(false)
        && Util.isRegistrationSupported(myActivity, link);
  }
  // Override
  public void buildContextMenu(NetworkBaseActivity activity, ContextMenu menu, NetworkTree tree) {
    menu.setHeaderTitle(tree.getName());

    final boolean isLoading =
        NetworkView.Instance()
            .containsItemsLoadingRunnable(NetworkSearchActivity.SEARCH_RUNNABLE_KEY);

    if (!isLoading) {
      addMenuItem(menu, RUN_SEARCH_ITEM_ID, "search");
    } else {
      addMenuItem(menu, TREE_NO_ACTION, "stoppingNetworkSearch");
    }
  }
Exemplo n.º 7
0
  @Override
  protected void onStart() {
    super.onStart();

    myAllItems.clear();

    final Intent intent = getIntent();

    myAllItems.add(new SectionItem("enabled"));
    final List<String> enabledIds =
        intent.getStringArrayListExtra(NetworkLibraryActivity.ENABLED_CATALOG_IDS_KEY);
    if (enabledIds.size() > 0) {
      final TreeSet<CatalogItem> cItems = new TreeSet<CatalogItem>();
      for (String id : enabledIds) {
        final NetworkTree tree = NetworkLibrary.Instance().getCatalogTreeByUrlAll(id);
        if (tree != null && tree.getLink() != null) {
          cItems.add(new CatalogItem(id, true, tree));
        }
      }
      myAllItems.addAll(cItems);
      mySelectedItems.addAll(cItems);
    }

    myAllItems.add(new SectionItem("disabled"));
    final List<String> disabledIds =
        intent.getStringArrayListExtra(NetworkLibraryActivity.DISABLED_CATALOG_IDS_KEY);
    if (disabledIds.size() > 0) {
      final TreeSet<CatalogItem> cItems = new TreeSet<CatalogItem>();
      for (String id : disabledIds) {
        cItems.add(
            new CatalogItem(id, false, NetworkLibrary.Instance().getCatalogTreeByUrlAll(id)));
      }
      myAllItems.addAll(cItems);
    }

    setListAdapter(new CatalogsListAdapter());
  }
Exemplo n.º 8
0
 @Override
 public void run(NetworkTree tree) {
   Util.runAuthenticationDialog(myActivity, tree.getLink(), null);
 }
Exemplo n.º 9
0
 public String getTitle() {
   return Tree.getLink().getTitle();
 }
Exemplo n.º 10
0
 @Override
 public boolean isVisible(NetworkTree tree) {
   return tree instanceof NetworkCatalogRootTree && tree.getLink() instanceof ICustomNetworkLink;
 }
Exemplo n.º 11
0
 @Override
 public void removeItems(Set<NetworkLibraryItem> items) {
   ChildrenItems.removeAll(items);
   super.removeItems(items);
 }
Exemplo n.º 12
0
 @Override
 protected void run(NetworkTree tree) {
   tree.getLink().basket().clear();
 }
Exemplo n.º 13
0
 @Override
 protected void run(NetworkTree tree) {
   Util.runRegistrationDialog(myActivity, tree.getLink());
 }