// Override public String getTreeTitle(NetworkTree tree) { final SearchResult result = ((SearchItemTree) tree).getSearchResult(); if (result != null) { return result.Summary; } return tree.getName(); }
@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); }
@Override public boolean isVisible(NetworkTree tree) { if (!(tree instanceof NetworkCatalogRootTree)) { return false; } final NetworkAuthenticationManager mgr = tree.getLink().authenticationManager(); return mgr != null && !mgr.mayBeAuthorised(false); }
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())); } }
@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"); } }
@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()); }
@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 public void removeItems(Set<NetworkLibraryItem> items) { ChildrenItems.removeAll(items); super.removeItems(items); }
@Override protected void run(NetworkTree tree) { tree.getLink().basket().clear(); }
@Override protected void run(NetworkTree tree) { Util.runRegistrationDialog(myActivity, tree.getLink()); }