- Rewording in sharing tab...
authorfstamatelopoulos <devnull@localhost>
Mon, 23 Mar 2009 13:57:44 +0000 (13:57 +0000)
committerfstamatelopoulos <devnull@localhost>
Mon, 23 Mar 2009 13:57:44 +0000 (13:57 +0000)
- move URI to "Sharing" tab
- show URI only when "Make public" is selected
(partial resolution of bug #636)

gss/src/gr/ebs/gss/client/FilePropertiesDialog.java
gss/src/gr/ebs/gss/client/PermissionsAddDialog.java

index fe160d4..b7a794a 100644 (file)
@@ -49,6 +49,7 @@ import com.google.gwt.user.client.ui.DialogBox;
 import com.google.gwt.user.client.ui.DisclosurePanel;\r
 import com.google.gwt.user.client.ui.FlexTable;\r
 import com.google.gwt.user.client.ui.FlowPanel;\r
+import com.google.gwt.user.client.ui.FocusListener;\r
 import com.google.gwt.user.client.ui.FocusPanel;\r
 import com.google.gwt.user.client.ui.HTML;\r
 import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
@@ -137,13 +138,14 @@ public class FilePropertiesDialog extends DialogBox {
                final HorizontalPanel buttons = new HorizontalPanel();\r
                final HorizontalPanel permButtons = new HorizontalPanel();\r
                final HorizontalPanel permForAll = new HorizontalPanel();\r
+               final HorizontalPanel pathPanel = new HorizontalPanel();\r
                final VerticalPanel verPanel = new VerticalPanel();\r
                final HorizontalPanel vPanel = new HorizontalPanel();\r
                final HorizontalPanel vPanel2 = new HorizontalPanel();\r
 \r
                versioned.setChecked(file.isVersioned());\r
                inner.add(generalPanel, "General");\r
-               inner.add(permPanel, "Permissions");\r
+               inner.add(permPanel, "Sharing");\r
                inner.add(verPanel, "Versions");\r
                inner.selectTab(0);\r
 \r
@@ -153,7 +155,6 @@ public class FilePropertiesDialog extends DialogBox {
                generalTable.setText(2, 0, "Owner");\r
                generalTable.setText(3, 0, "Date");\r
                generalTable.setText(4, 0, "Tags");\r
-               generalTable.setText(5, 0, "URI");\r
                name.setText(file.getName());\r
                generalTable.setWidget(0, 1, name);\r
                if (GSS.get().getFolders().getCurrent() != null && GSS.get().getFolders().getCurrent().getUserObject() instanceof FolderResource) {\r
@@ -178,23 +179,16 @@ public class FilePropertiesDialog extends DialogBox {
                initialTagText = tagsBuffer.toString();\r
                tags.setText(initialTagText);\r
                generalTable.setWidget(4, 1, tags);\r
-               TextBox path = new TextBox();\r
-               path.setText(file.getPath());\r
-               path.setTitle("Use this URI for sharing this file with the world");\r
-               path.setReadOnly(true);\r
-               generalTable.setWidget(5, 1, path);\r
                generalTable.getFlexCellFormatter().setStyleName(0, 0, "props-labels");\r
                generalTable.getFlexCellFormatter().setStyleName(1, 0, "props-labels");\r
                generalTable.getFlexCellFormatter().setStyleName(2, 0, "props-labels");\r
                generalTable.getFlexCellFormatter().setStyleName(3, 0, "props-labels");\r
                generalTable.getFlexCellFormatter().setStyleName(4, 0, "props-labels");\r
-               generalTable.getFlexCellFormatter().setStyleName(5, 0, "props-labels");\r
                generalTable.getFlexCellFormatter().setStyleName(0, 1, "props-values");\r
                generalTable.getFlexCellFormatter().setStyleName(1, 1, "props-values");\r
                generalTable.getFlexCellFormatter().setStyleName(2, 1, "props-values");\r
                generalTable.getFlexCellFormatter().setStyleName(3, 1, "props-values");\r
                generalTable.getFlexCellFormatter().setStyleName(4, 1, "props-values");\r
-               generalTable.getFlexCellFormatter().setStyleName(5, 1, "props-values");\r
                generalTable.setCellSpacing(4);\r
 \r
                // Create the 'OK' button, along with a listener that hides the dialog\r
@@ -273,18 +267,23 @@ public class FilePropertiesDialog extends DialogBox {
                readForAll.addClickListener(new ClickListener() {\r
 \r
                        public void onClick(Widget sender) {\r
-                               if (readForAll.isChecked())\r
+                               if (readForAll.isChecked()) {\r
                                        readForAllNote.setVisible(true);\r
-                               else\r
+                                       pathPanel.setVisible(true);\r
+                               }\r
+                               else {\r
                                        readForAllNote.setVisible(false);\r
+                                       pathPanel.setVisible(false);\r
+                               }\r
                        }\r
 \r
                });\r
+\r
                permPanel.add(permList);\r
                permPanel.add(permButtons);\r
                //only show the read for all perm if the user is the owner\r
                if (file.getOwner().equals(GSS.get().getCurrentUserResource().getUsername())) {\r
-                       permForAll.add(new Label("Read For All:"));\r
+                       permForAll.add(new Label("Make Public:"));\r
                        permForAll.add(readForAll);\r
                        permForAll.setSpacing(8);\r
                        permForAll.addStyleName("gwt-TabPanelBottom");\r
@@ -292,6 +291,25 @@ public class FilePropertiesDialog extends DialogBox {
                        permPanel.add(readForAllNote);\r
                }\r
 \r
+               TextBox path = new TextBox();\r
+               path.addFocusListener(new FocusListener() {\r
+                       public void onFocus(Widget sender) {\r
+                               ((TextBox) sender).selectAll();\r
+                       }\r
+                       public void onLostFocus(Widget sender) {\r
+                               ((TextBox) sender).setSelectionRange(0, 0);\r
+                       }\r
+               });\r
+               path.setText(file.getPath());\r
+               path.setTitle("Use this URI for sharing this file with the world");\r
+               path.setReadOnly(true);\r
+               pathPanel.add(new Label("Sharing URI:"));\r
+               pathPanel.setSpacing(8);\r
+               pathPanel.addStyleName("gwt-TabPanelBottom");\r
+               pathPanel.add(path);\r
+               pathPanel.setVisible(false);\r
+               permPanel.add(pathPanel);\r
+\r
                VersionsList verList = new VersionsList(this, images, bodies);\r
                verPanel.add(verList);\r
 \r
index a2b860e..21e72a3 100644 (file)
@@ -75,7 +75,7 @@ public class PermissionsAddDialog extends DialogBox {
                permTable.setText(0, 0, "Users/Groups");
                permTable.setText(0, 1, "Read");
                permTable.setText(0, 2, "Write");
-               permTable.setText(0, 3, "Modify ACL");
+               permTable.setText(0, 3, "Modify Permissions");
                permTable.getFlexCellFormatter().setStyleName(0, 0, "props-toplabels");
                permTable.getFlexCellFormatter().setStyleName(0, 1, "props-toplabels");
                permTable.getFlexCellFormatter().setStyleName(0, 2, "props-toplabels");