Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-10-10 08:04:32 +0000
committerEike Stepper2015-10-10 08:04:32 +0000
commitb9bec64db5d3d403beaeddc761e109bccd561253 (patch)
tree747509e65d6e4f24f83f2b4d2cb47b0cf971f5cb /plugins/org.eclipse.emf.cdo.explorer.ui
parent7b5b1da475c629fc3644c58e89d54e65c41f04df (diff)
downloadcdo-b9bec64db5d3d403beaeddc761e109bccd561253.tar.gz
cdo-b9bec64db5d3d403beaeddc761e109bccd561253.tar.xz
cdo-b9bec64db5d3d403beaeddc761e109bccd561253.zip
[479422] CDO Credential Provider not implemented for CDORepositoryImpl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=479422
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/MasterRepositoryController.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/NewRepositoryWizard.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryRemotePage.java7
4 files changed, 26 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
index 57413bf0f9..aa6e7d8aa1 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/AbstractRepositoryPage.java
@@ -16,6 +16,8 @@ import org.eclipse.emf.cdo.explorer.ui.checkouts.wizards.CheckoutWizardPage.Vali
import org.eclipse.emf.cdo.internal.explorer.AbstractElement;
import org.eclipse.emf.cdo.internal.explorer.repositories.CDORepositoryImpl;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
+
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
@@ -66,6 +68,11 @@ public abstract class AbstractRepositoryPage extends WizardPage implements Selec
return properties;
}
+ public IPasswordCredentials getCredentials()
+ {
+ return null;
+ }
+
public void createControl(Composite parent)
{
Composite container = new Composite(parent, SWT.NULL);
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/MasterRepositoryController.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/MasterRepositoryController.java
index d88eb784f0..8a02474d50 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/MasterRepositoryController.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/MasterRepositoryController.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.cdo.session.CDORepositoryInfo;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.container.ContainerEventAdapter;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
@@ -35,6 +36,7 @@ import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.security.IPasswordCredentials;
import org.eclipse.net4j.util.security.IPasswordCredentialsProvider;
import org.eclipse.net4j.util.security.NotAuthenticatedException;
+import org.eclipse.net4j.util.security.PasswordCredentials;
import org.eclipse.net4j.util.security.PasswordCredentialsProvider;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
@@ -228,14 +230,14 @@ public class MasterRepositoryController
return repositoryName;
}
- public final String getUserName()
+ public final IPasswordCredentials getCredentials()
{
- return userName;
- }
+ if (userNameText.isEnabled() && !StringUtil.isEmpty(userName))
+ {
+ return new PasswordCredentials(userName, password);
+ }
- public final String getPassword()
- {
- return password;
+ return null;
}
public final VersioningMode getVersioningMode()
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/NewRepositoryWizard.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/NewRepositoryWizard.java
index d811a090f4..8c3ae5dd32 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/NewRepositoryWizard.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/NewRepositoryWizard.java
@@ -15,6 +15,8 @@ import org.eclipse.emf.cdo.explorer.repositories.CDORepository;
import org.eclipse.emf.cdo.explorer.repositories.CDORepositoryManager;
import org.eclipse.emf.cdo.explorer.ui.bundle.OM;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -84,9 +86,10 @@ public class NewRepositoryWizard extends Wizard
{
AbstractRepositoryPage page = typePage.getNextPage();
Properties properties = page.getProperties();
+ IPasswordCredentials credentials = page.getCredentials();
CDORepositoryManager repositoryManager = CDOExplorerUtil.getRepositoryManager();
- final CDORepository repository = repositoryManager.addRepository(properties);
+ final CDORepository repository = repositoryManager.addRepository(properties, credentials);
new Job("Connect")
{
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryRemotePage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryRemotePage.java
index d77e59459e..5e316994e2 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryRemotePage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryRemotePage.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.explorer.ui.checkouts.wizards.CheckoutWizardPage.Vali
import org.eclipse.emf.cdo.internal.explorer.repositories.RemoteCDORepository;
import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
import org.eclipse.net4j.util.ui.UIUtil;
import org.eclipse.swt.widgets.Composite;
@@ -37,6 +38,12 @@ public class RepositoryRemotePage extends AbstractRepositoryPage
}
@Override
+ public IPasswordCredentials getCredentials()
+ {
+ return controller.getCredentials();
+ }
+
+ @Override
protected void fillPage(Composite container)
{
controller = new MasterRepositoryController(container)

Back to the top