Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-09 07:22:36 +0000
committerEike Stepper2012-06-09 07:22:36 +0000
commita585f0a578c8f0f5c0f480be6f4876bbba11d021 (patch)
tree0d0490117868a2d11c754d0f4d64588a86d3c748 /plugins
parente06eb8fcf933e268547740d9d8be91ba0c77c320 (diff)
downloadcdo-a585f0a578c8f0f5c0f480be6f4876bbba11d021.tar.gz
cdo-a585f0a578c8f0f5c0f480be6f4876bbba11d021.tar.xz
cdo-a585f0a578c8f0f5c0f480be6f4876bbba11d021.zip
[381472] Design a repository administration API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=381472
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/CDOAdminView.java35
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java5
2 files changed, 38 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/CDOAdminView.java b/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/CDOAdminView.java
index ac3bb27ac7..90d7435583 100644
--- a/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/CDOAdminView.java
+++ b/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/CDOAdminView.java
@@ -16,11 +16,11 @@ import org.eclipse.emf.cdo.common.admin.CDOAdminRepository;
import org.eclipse.emf.cdo.ui.internal.admin.bundle.OM;
import org.eclipse.emf.cdo.ui.shared.SharedIcons;
-import org.eclipse.net4j.ui.Net4jItemProvider.RemoveAction;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.views.ContainerView;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
@@ -142,7 +142,7 @@ public class CDOAdminView extends ContainerView
Object obj = selection.getFirstElement();
if (obj instanceof CDOAdminClient)
{
- manager.add(new RemoveAction(obj));
+ manager.add(new RemoveAction(adminManager, (CDOAdminClient)obj));
}
}
}
@@ -177,4 +177,35 @@ public class CDOAdminView extends ContainerView
manager.add(addConnectionAction);
super.fillLocalToolBar(manager);
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class RemoveAction extends org.eclipse.net4j.ui.Net4jItemProvider.RemoveAction
+ {
+ private CDOAdminClientManager adminManager;
+
+ public RemoveAction(CDOAdminClientManager adminManager, CDOAdminClient admin)
+ {
+ super(admin);
+ this.adminManager = adminManager;
+ }
+
+ public CDOAdminClientManager getAdminManager()
+ {
+ return adminManager;
+ }
+
+ @Override
+ public CDOAdminClient getObject()
+ {
+ return (CDOAdminClient)super.getObject();
+ }
+
+ @Override
+ protected void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ adminManager.removeConnection(getObject());
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
index e6cd5dc16c..dd368eb666 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
@@ -90,6 +90,11 @@ public class Net4jItemProvider extends ContainerItemProvider<IContainer<Object>>
this.object = object;
}
+ public Object getObject()
+ {
+ return object;
+ }
+
@Override
protected void doRun(IProgressMonitor progressMonitor) throws Exception
{

Back to the top