summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-28 05:47:25 (EDT)
committerEike Stepper2007-09-28 05:47:25 (EDT)
commite00c1faac3659bc4ea32882f5146bddd41266603 (patch)
tree698aa0b1cf8f13fe08c35bb4b743cc6b258ac3f9
parentb136c213f3dbd4f187e62f64c1d9f30e7ab68c8b (diff)
downloadcdo-e00c1faac3659bc4ea32882f5146bddd41266603.zip
cdo-e00c1faac3659bc4ea32882f5146bddd41266603.tar.gz
cdo-e00c1faac3659bc4ea32882f5146bddd41266603.tar.bz2
[204732] Add dialog for "Open Session"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204732
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/OpenSessionDialog.java31
2 files changed, 30 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
index ffb9488..0683822 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
@@ -33,9 +33,15 @@ public final class OpenSessionAction extends LongRunningAction
protected void preRun() throws Exception
{
OpenSessionDialog dialog = new OpenSessionDialog(page);
- dialog.open();
- description = dialog.getDescription();
- if (description == null)
+ if (dialog.open() == OpenSessionDialog.OK)
+ {
+ description = dialog.getServerDescription() + "/" + dialog.getRepositoryName();
+ if (!dialog.isLegacySupport())
+ {
+ description += "?disableLegacyObjects=true";
+ }
+ }
+ else
{
cancel();
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/OpenSessionDialog.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/OpenSessionDialog.java
index ac8f2f5..652a6fe 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/OpenSessionDialog.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dialogs/OpenSessionDialog.java
@@ -49,10 +49,14 @@ public class OpenSessionDialog extends TitleAreaDialog
private HistoryText repository;
- private String description;
-
private PreferenceButton legacy;
+ private String serverDescription;
+
+ private String repositoryName;
+
+ private boolean legacySupport;
+
public OpenSessionDialog(IWorkbenchPage page)
{
super(new Shell(page.getWorkbenchWindow().getShell()));
@@ -65,9 +69,19 @@ public class OpenSessionDialog extends TitleAreaDialog
return page;
}
- public String getDescription()
+ public String getServerDescription()
+ {
+ return serverDescription;
+ }
+
+ public String getRepositoryName()
+ {
+ return repositoryName;
+ }
+
+ public boolean isLegacySupport()
{
- return description;
+ return legacySupport;
}
@Override
@@ -121,12 +135,9 @@ public class OpenSessionDialog extends TitleAreaDialog
@Override
protected void okPressed()
{
- description = connector.getText() + "/" + repository.getText();
- if (!legacy.getSelection())
- {
- description += "?disableLegacyObjects=true";
- }
-
+ serverDescription = connector.getText();
+ repositoryName = repository.getText();
+ legacySupport = legacy.getSelection();
super.okPressed();
}
}