@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);
 }
Exemple #2
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);
  }
  @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
  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());
  }
Exemple #5
0
 @Override
 public void run(NetworkTree tree) {
   Util.runAuthenticationDialog(myActivity, tree.getLink(), null);
 }
 public String getTitle() {
   return Tree.getLink().getTitle();
 }
 @Override
 public boolean isVisible(NetworkTree tree) {
   return tree instanceof NetworkCatalogRootTree && tree.getLink() instanceof ICustomNetworkLink;
 }
 @Override
 protected void run(NetworkTree tree) {
   tree.getLink().basket().clear();
 }
 @Override
 protected void run(NetworkTree tree) {
   Util.runRegistrationDialog(myActivity, tree.getLink());
 }