Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-09 02:36:38 -0400
committerEike Stepper2012-06-09 02:36:38 -0400
commit84a2fd8264d648fc3e5843998ef5f945c8def778 (patch)
tree9b020319f25e65a691bbba7b1c7db54d2d1eec97 /plugins
parentf8aaeebdc8d20dd68e9a0087e1cede40d2e1d38b (diff)
downloadcdo-84a2fd8264d648fc3e5843998ef5f945c8def778.tar.gz
cdo-84a2fd8264d648fc3e5843998ef5f945c8def778.tar.xz
cdo-84a2fd8264d648fc3e5843998ef5f945c8def778.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.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/bundle/OM.java22
2 files changed, 23 insertions, 3 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 4e2e5b580a..a35920a182 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
@@ -139,10 +139,12 @@ public class CDOAdminView extends ContainerView
@Override
public void run()
{
- InputDialog dialog = new InputDialog(getShell(), getText(), "Enter the connection URL:", null, null);
+ String lastURL = OM.getLastURL();
+ InputDialog dialog = new InputDialog(getShell(), getText(), "Enter the connection URL:", lastURL, null);
if (dialog.open() == InputDialog.OK)
{
String url = dialog.getValue();
+ OM.setLastURL(url);
adminManager.addConnection(url);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/bundle/OM.java b/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/bundle/OM.java
index 12e36e6e6d..a93a043716 100644
--- a/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.ui.admin/src/org/eclipse/emf/cdo/ui/internal/admin/bundle/OM.java
@@ -23,7 +23,6 @@ import org.eclipse.net4j.util.ui.UIActivator;
import org.eclipse.jface.resource.ImageDescriptor;
-import java.util.Collection;
import java.util.List;
/**
@@ -48,6 +47,18 @@ public abstract class OM
return adminManager;
}
+ private static String lastURL;
+
+ public static String getLastURL()
+ {
+ return lastURL;
+ }
+
+ public static void setLastURL(String lastURL)
+ {
+ OM.lastURL = lastURL;
+ }
+
public static ImageDescriptor getImageDescriptor(String imageFilePath)
{
return Activator.imageDescriptorFromPlugin(BUNDLE_ID, imageFilePath);
@@ -70,7 +81,12 @@ public abstract class OM
if (state instanceof List<?>)
{
@SuppressWarnings("unchecked")
- Collection<String> urls = (Collection<String>)state;
+ List<String> urls = (List<String>)state;
+ if (!urls.isEmpty())
+ {
+ lastURL = urls.remove(0);
+ }
+
adminManager.addConnections(urls);
}
}
@@ -79,6 +95,8 @@ public abstract class OM
protected Object doStopWithState() throws Exception
{
List<String> urls = adminManager.getConnectionURLs();
+ urls.add(0, lastURL);
+
LifecycleUtil.deactivate(adminManager);
return urls;
}

Back to the top