Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-06-11 05:49:15 +0000
committerEike Stepper2012-06-11 05:49:15 +0000
commitf1db8cd1815ae61d194044ddad8d6ae0fea15cdc (patch)
treefe65873c47124c3baef1745e5224c5803a10dec0 /plugins/org.eclipse.emf.cdo.ui/src
parent912124f7f602c766f25ededa9af1e51c459503be (diff)
downloadcdo-f1db8cd1815ae61d194044ddad8d6ae0fea15cdc.tar.gz
cdo-f1db8cd1815ae61d194044ddad8d6ae0fea15cdc.tar.xz
cdo-f1db8cd1815ae61d194044ddad8d6ae0fea15cdc.zip
[380629] Design a default Security model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=380629
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java49
1 files changed, 38 insertions, 11 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 a6924487dc..10633ed604 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
@@ -12,6 +12,7 @@
package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator;
+import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.emf.cdo.internal.ui.dialogs.OpenSessionDialog;
import org.eclipse.emf.cdo.internal.ui.messages.Messages;
@@ -20,6 +21,7 @@ import org.eclipse.emf.cdo.ui.widgets.SessionComposite;
import org.eclipse.emf.internal.cdo.session.CDOSessionFactory;
+import org.eclipse.net4j.signal.RemoteException;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.ui.actions.LongRunningAction;
@@ -66,27 +68,52 @@ public final class OpenSessionAction extends LongRunningAction
{
try
{
+ IManagedContainer container = getContainer();
+ String productGroup = CDOSessionFactory.PRODUCT_GROUP;
String description = sessionComposite.getSessionDescription();
- final InternalCDOSession session = (InternalCDOSession)getContainer().getElement(CDOSessionFactory.PRODUCT_GROUP,
- "cdo", description); //$NON-NLS-1$
+ InternalCDOSession session = (InternalCDOSession)container.getElement(productGroup, "cdo", description); //$NON-NLS-1$
if (sessionComposite.isAutomaticRegistry())
{
CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
}
}
- catch (final RuntimeException ex)
+ catch (RemoteException ex)
{
- OM.LOG.error(ex);
- getDisplay().asyncExec(new Runnable()
+ Throwable cause = ex.getCause();
+ if (cause instanceof NotAuthenticatedException)
{
- public void run()
- {
- MessageDialog.openError(getShell(), getText(), Messages.getString("OpenSessionAction.3") //$NON-NLS-1$
- + ex.getMessage());
- }
- });
+ // Skip silently because user has canceled the authentication
+ }
+ else
+ {
+ showError(cause);
+ }
}
+ catch (Exception ex)
+ {
+ if (ex instanceof NotAuthenticatedException)
+ {
+ // Skip silently because user has canceled the authentication
+ }
+ else
+ {
+ showError(ex);
+ }
+ }
+ }
+
+ protected void showError(final Throwable ex)
+ {
+ OM.LOG.error(ex);
+ getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ MessageDialog.openError(getShell(), getText(), Messages.getString("OpenSessionAction.3") //$NON-NLS-1$
+ + ex.getMessage());
+ }
+ });
}
protected IManagedContainer getContainer()

Back to the top