public void modificSite() { if (!isSelected()) { Notification.show("You must select at least one"); return; } Collection<URI> selected = getSelected(); if (selected.size() > 1) { Notification.show("You must select only one entry"); return; } URI uri = selected.iterator().next(); final AddSiteDialog addSiteDialog = new AddSiteDialog( sitesManager, agent, uri.toString(), sitesManager.getReposiotoryNickName(agent, uri)); mainLayout.getUI().addWindow(addSiteDialog); addSiteDialog.addCloseListener( new CloseListener() { @Override public void windowClose(CloseEvent e) { // TODO Auto-generated method stub if (addSiteDialog.isInstalled()) { loadSites(); } } }); }
public void loadSites() { treeTable.removeAllItems(); List<URI> listAllUpdateSites = sitesManager.listAllUpdateSites(agent); for (URI uri : listAllUpdateSites) { String string = uri.toString(); treeTable.addItem( new Object[] { sitesManager.getReposiotoryNickName(agent, uri), uri.toString(), "" + sitesManager.isRepositoryEnabled(agent, uri) }, uri); } }
public void removeSite(String uri) { try { sitesManager.removeRepository(uri, agent); } catch (RuntimeException e) { e.printStackTrace(); return; } }