]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java
Add dep folder
[lgpl/argeo-commons.git] / security / plugins / org.argeo.security.ui / src / main / java / org / argeo / security / ui / dialogs / AbstractLoginDialog.java
index 92ca3d85de5aabe190cfb6720f6f87b82e2355f4..7c7e0c6b6cb4a0547ef37ed84ea2471ea1e61bb0 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.argeo.security.ui.dialogs;
 
 import java.io.IOException;
@@ -79,6 +94,7 @@ public abstract class AbstractLoginDialog extends TrayDialog implements
                                isCancelled = false;
                                setBlockOnOpen(false);
                                open();
+
                                final Button okButton = getButton(IDialogConstants.OK_ID);
                                okButton.setText("Login");
                                okButton.addSelectionListener(new SelectionListener() {
@@ -124,10 +140,10 @@ public abstract class AbstractLoginDialog extends TrayDialog implements
                                                // when the OSGi runtime is shut down
                                                try {
                                                        Thread.sleep(100);
-                                                       if (display.isDisposed()) {
-                                                               log.warn("Display is disposed, killing login dialog thread");
-                                                               throw new ThreadDeath();
-                                                       }
+                                                       // if (display.isDisposed()) {
+                                                       // log.warn("Display is disposed, killing login dialog thread");
+                                                       // throw new ThreadDeath();
+                                                       // }
                                                } catch (final Exception e) {
                                                        // do nothing
                                                }
@@ -147,6 +163,7 @@ public abstract class AbstractLoginDialog extends TrayDialog implements
                        }, true, new NullProgressMonitor(), Display.getDefault());
                } catch (ThreadDeath e) {
                        isCancelled = true;
+                       log.debug("Thread " + Thread.currentThread().getId() + " died");
                        throw e;
                } catch (Exception e) {
                        isCancelled = true;
@@ -157,18 +174,18 @@ public abstract class AbstractLoginDialog extends TrayDialog implements
                } finally {
                        // so that the modal thread dies
                        processCallbacks = true;
-                       try {
-                               // wait for the modal context thread to gracefully exit
-                               modalContextThread.join(1000);
-                       } catch (InterruptedException ie) {
-                               // silent
-                       }
+                       // try {
+                       // // wait for the modal context thread to gracefully exit
+                       // modalContextThread.join();
+                       // } catch (InterruptedException ie) {
+                       // // silent
+                       // }
                        modalContextThread = null;
                }
        }
 
        protected void configureShell(Shell shell) {
                super.configureShell(shell);
-               shell.setText("Login");
+               shell.setText("Authentication");
        }
 }