ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1535765 - /ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java
Date Fri, 25 Oct 2013 15:29:19 GMT
Author: jawi
Date: Fri Oct 25 15:29:19 2013
New Revision: 1535765

URL: http://svn.apache.org/r1535765
Log:
Some small bugfixes:

- fixed deprecation warning;
- make the dialog a little more robust when the bundle is 
  updated at runtime.


Modified:
    ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java

Modified: ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java?rev=1535765&r1=1535764&r2=1535765&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java
(original)
+++ ace/trunk/org.apache.ace.useradmin.ui/src/org/apache/ace/useradmin/ui/vaadin/UserAdminWindow.java
Fri Oct 25 15:29:19 2013
@@ -28,6 +28,7 @@ import org.apache.ace.useradmin.ui.edito
 import org.osgi.service.useradmin.Group;
 import org.osgi.service.useradmin.User;
 
+import com.vaadin.Application;
 import com.vaadin.data.Property.ValueChangeEvent;
 import com.vaadin.data.Property.ValueChangeListener;
 import com.vaadin.event.ItemClickEvent;
@@ -83,7 +84,8 @@ public class UserAdminWindow extends Win
         setCaption("Manage users");
         if (m_userUtil.hasRole(m_currentUser, "editUsers")) {
             adminMode = true;
-            getLayout().setSizeFull();
+
+            setSizeFull();
             addComponent(createAdminWindowLayout());
             populateUserTableAndSelect();
         }
@@ -100,14 +102,20 @@ public class UserAdminWindow extends Win
      * Will be called when a dependency isn't available
      */
     public void destroy() {
-        if (adminMode) {
-            getApplication().getMainWindow().showNotification("Oops", "Manage Users function
has been disabled", Notification.TYPE_ERROR_MESSAGE);
-        }
-        else {
-            getApplication().getMainWindow().showNotification("Oops", "My info function has
been disabled", Notification.TYPE_ERROR_MESSAGE);
-        }
         close();
-        getApplication().removeWindow(this);
+
+        Application application = getApplication();
+        if (application != null) {
+            Window mainWindow = application.getMainWindow();
+            if (mainWindow != null) {
+                if (adminMode) {
+                    mainWindow.showNotification("Oops", "Manage Users function has been disabled",
Notification.TYPE_ERROR_MESSAGE);
+                }
+                else {
+                    mainWindow.showNotification("Oops", "My info function has been disabled",
Notification.TYPE_ERROR_MESSAGE);
+                }
+            }
+        }
     }
 
     private void initializeUserDTO() {



Mime
View raw message