[458349] Consolidate UI 

Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
index 94ff1e0..052d6d3 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
@@ -94,7 +94,7 @@
     int dashBoardHeight = OM.PREF_DASHBOARD_HEIGHT.getValue();
     if (dashBoardHeight >= 0)
     {
-      showDashboard(getViewer(), getViewSite().getPage());
+      // showDashboard(getViewer(), getViewSite().getPage());
     }
   }
 
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
index 6ccd089..067e3ff 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/repositories/wizards/RepositoryLocalPage.java
@@ -105,7 +105,7 @@
 
     Group modeGroup = new Group(composite, SWT.NONE);
     modeGroup.setLayout(new GridLayout(1, false));
-    modeGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
+    modeGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
     modeGroup.setText("Versioning Mode");
 
     normalButton = new Button(modeGroup, SWT.RADIO);
@@ -123,7 +123,7 @@
 
     Group idGroup = new Group(composite, SWT.NONE);
     idGroup.setLayout(new GridLayout(1, false));
-    idGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
+    idGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
     idGroup.setText("ID Generation");
 
     counterButton = new Button(idGroup, SWT.RADIO);
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
index 7d8b9bc..ab73a76 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/repositories/CDORepository.java
@@ -20,6 +20,8 @@
 import org.eclipse.emf.cdo.view.CDOViewOpener;
 
 import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
+import org.eclipse.net4j.util.security.IPasswordCredentialsProvider2;
 
 /**
  * A CDO server independent representation of a repository.
@@ -27,8 +29,8 @@
  * @author Eike Stepper
  * @since 4.4
  */
-public interface CDORepository extends CDOExplorerElement, IContainer<CDOBranch>, CDOSessionProvider, CDOViewOpener,
-    CDOTransactionOpener
+public interface CDORepository extends CDOExplorerElement, IContainer<CDOBranch>, IPasswordCredentialsProvider2,
+    CDOSessionProvider, CDOViewOpener, CDOTransactionOpener
 {
   public static final String TYPE_REMOTE = "remote";
 
@@ -54,6 +56,10 @@
 
   public IDGeneration getIDGeneration();
 
+  public IPasswordCredentials getCredentials();
+
+  public void setCredentials(IPasswordCredentials credentials);
+
   public State getState();
 
   public boolean isConnected();
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
index 96c5d92..1bfa484 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryImpl.java
@@ -41,6 +41,7 @@
 import org.eclipse.net4j.util.event.IListener;
 import org.eclipse.net4j.util.lifecycle.ILifecycle;
 import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
+import org.eclipse.net4j.util.security.IPasswordCredentials;
 
 import org.eclipse.emf.ecore.resource.ResourceSet;
 
@@ -57,6 +58,8 @@
 {
   public static final String PROP_NAME = "name";
 
+  public static final String PROP_REALM = "realm";
+
   public static final String REPOSITORY_KEY = CDORepository.class.getName();
 
   private final Set<CDOCheckout> checkouts = new HashSet<CDOCheckout>();
@@ -111,6 +114,8 @@
 
   private CDORepository.IDGeneration idGeneration;
 
+  private String realm;
+
   private State state = State.Disconnected;
 
   private boolean explicitelyConnected;
@@ -153,6 +158,25 @@
     return idGeneration;
   }
 
+  public IPasswordCredentials getCredentials()
+  {
+    return getCredentials(null);
+  }
+
+  public IPasswordCredentials getCredentials(String realm)
+  {
+    return null;
+  }
+
+  public void setCredentials(IPasswordCredentials credentials)
+  {
+  }
+
+  public boolean isInteractive()
+  {
+    return false;
+  }
+
   public final State getState()
   {
     return state;
@@ -481,9 +505,9 @@
   {
     super.init(folder, type, properties);
     name = properties.getProperty(PROP_NAME);
-    versioningMode = CDORepository.VersioningMode.valueOf(properties
-        .getProperty(CDORepositoryImpl.PROP_VERSIONING_MODE));
-    idGeneration = CDORepository.IDGeneration.valueOf(properties.getProperty(CDORepositoryImpl.PROP_ID_GENERATION));
+    versioningMode = VersioningMode.valueOf(properties.getProperty(PROP_VERSIONING_MODE));
+    idGeneration = IDGeneration.valueOf(properties.getProperty(PROP_ID_GENERATION));
+    realm = properties.getProperty(PROP_REALM);
   }
 
   @Override
@@ -491,8 +515,13 @@
   {
     super.collectProperties(properties);
     properties.setProperty(PROP_NAME, name);
-    properties.setProperty(CDORepositoryImpl.PROP_VERSIONING_MODE, versioningMode.toString());
-    properties.setProperty(CDORepositoryImpl.PROP_ID_GENERATION, idGeneration.toString());
+    properties.setProperty(PROP_VERSIONING_MODE, versioningMode.toString());
+    properties.setProperty(PROP_ID_GENERATION, idGeneration.toString());
+
+    if (realm != null)
+    {
+      properties.setProperty(PROP_REALM, realm);
+    }
   }
 
   protected IConnector getConnector()
@@ -516,6 +545,7 @@
     CDOSessionConfiguration sessionConfiguration = createSessionConfiguration();
     sessionConfiguration.setPassiveUpdateEnabled(true);
     sessionConfiguration.setPassiveUpdateMode(PassiveUpdateMode.CHANGES);
+    sessionConfiguration.setCredentialsProvider(this);
 
     CDOSession session = sessionConfiguration.openSession();
     session.options().setGeneratedPackageEmulationEnabled(true);
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
index f8fa77e..2bdee9f 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/repositories/CDORepositoryManagerImpl.java
@@ -27,6 +27,8 @@
  */
 public class CDORepositoryManagerImpl extends AbstractManager<CDORepository> implements CDORepositoryManager
 {
+  public static final String SECURE_STORE_PATH = "/CDO/repositories";
+
   private static final String PROPERTIES_FILE = "repository.properties";
 
   private final Map<CDOSession, CDORepository> sessionMap = new ConcurrentHashMap<CDOSession, CDORepository>();