Fixed equals to consider owner apart from uri
[pithos-web-client] / src / gr / grnet / pithos / web / client / AbstractPropertiesDialog.java
index 4920b56..0c53546 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright 2011 GRNET S.A. All rights reserved.\r
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.\r
  *\r
  * Redistribution and use in source and binary forms, with or\r
  * without modification, are permitted provided that the following\r
@@ -38,9 +38,7 @@ import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.event.dom.client.KeyCodes;\r
 import com.google.gwt.user.client.Event.NativePreviewEvent;\r
 import com.google.gwt.user.client.ui.DialogBox;\r
-import com.google.gwt.user.client.ui.FlowPanel;\r
-import com.google.gwt.user.client.ui.TabPanel;\r
-import com.google.gwt.user.client.ui.TextBox;\r
+import com.google.gwt.user.client.ui.VerticalPanel;\r
 \r
 /**\r
  * Abstract class, parent of all 'File properties' dialog boxes.\r
@@ -50,7 +48,7 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
 \r
        protected static final String MULTIPLE_VALUES_TEXT = "(Multiple values)";\r
 \r
-       protected TabPanel inner = null;\r
+       protected VerticalPanel inner = null;\r
 \r
     protected Pithos app;\r
 \r
@@ -69,9 +67,10 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
 \r
        /**\r
         * Accepts any change and updates the file\r
+        * @return \r
         *\r
         */\r
-       protected abstract void accept();\r
+       protected abstract boolean accept();\r
 \r
        @Override\r
        protected void onPreviewNativeEvent(NativePreviewEvent preview) {\r
@@ -83,21 +82,15 @@ public abstract class AbstractPropertiesDialog extends DialogBox {
                          // enter or escape is pressed.\r
                          switch (evt.getKeyCode()) {\r
                            case KeyCodes.KEY_ENTER:\r
-                               accept();\r
-                           //$FALL-THROUGH$\r
+                               if (accept())\r
+                                       closeDialog();\r
+                               break;\r
                        case KeyCodes.KEY_ESCAPE:\r
                                closeDialog();\r
                                break;\r
                          }\r
          }\r
 \r
-\r
-\r
-       public void selectTab(int _tab) {\r
-               inner.selectTab(_tab);\r
-       }\r
-\r
-\r
        /**\r
         * Enables IE selection prevention and hides the dialog\r
         * (we disable the prevention on creation of the dialog)\r