import java.util.Set;\r
\r
import com.google.gwt.core.client.GWT;\r
+import com.google.gwt.event.dom.client.ChangeEvent;\r
+import com.google.gwt.event.dom.client.ChangeHandler;\r
import com.google.gwt.event.dom.client.ClickEvent;\r
import com.google.gwt.event.dom.client.ClickHandler;\r
+import com.google.gwt.event.dom.client.KeyDownEvent;\r
+import com.google.gwt.event.dom.client.KeyDownHandler;\r
import com.google.gwt.i18n.client.DateTimeFormat;\r
import com.google.gwt.json.client.JSONArray;\r
import com.google.gwt.json.client.JSONBoolean;\r
setText("File properties");\r
\r
file = (FileResource) GSS.get().getCurrentSelection();\r
- permList = new PermissionsList(images, file.getPermissions(), file.getOwner());\r
userFullName = _userFullName;\r
+ permList = new PermissionsList(images, file.getPermissions(), file.getOwner());\r
+\r
\r
// Outer contains inner and buttons.\r
final VerticalPanel outer = new VerticalPanel();\r
inner.add(verPanel, "Versions");\r
inner.selectTab(0);\r
\r
+ final Label fileNameNote = new Label("Please note that slashes ('/') are not allowed in file names.", true);\r
+ fileNameNote.setVisible(false);\r
+ fileNameNote.setStylePrimaryName("gss-readForAllNote");\r
+\r
final FlexTable generalTable = new FlexTable();\r
generalTable.setText(0, 0, "Name");\r
generalTable.setText(1, 0, "Folder");\r
name.setWidth("100%");\r
name.setText(file.getName());\r
generalTable.setWidget(0, 1, name);\r
+ name.addChangeHandler(new ChangeHandler() {\r
+\r
+ @Override\r
+ public void onChange(ChangeEvent event) {\r
+ if(name.getText().contains("/"))\r
+ fileNameNote.setVisible(true);\r
+ else\r
+ fileNameNote.setVisible(false);\r
+\r
+ }\r
+ });\r
+\r
if(file.getFolderName() != null)\r
generalTable.setText(1, 1, file.getFolderName());\r
else\r
generalTable.setText(1, 1, "-");\r
+ generalTable.setWidget(0, 2, fileNameNote);\r
generalTable.setText(2, 1,userFullName);\r
\r
final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");\r
final Button ok = new Button("OK", new ClickHandler() {\r
@Override\r
public void onClick(ClickEvent event) {\r
- accept();\r
- closeDialog();\r
+ if(name.getText().contains("/"))\r
+ fileNameNote.setVisible(true);\r
+ else{\r
+ fileNameNote.setVisible(true);\r
+ accept();\r
+ closeDialog();\r
+ } \r
}\r
});\r
buttons.add(ok);\r
};\r
DeferredCommand.addCommand(cf);\r
}\r
- private boolean hasOwner(String _userName) {\r
- if (GSS.get().findUserFullName(_userName) == null)\r
- return false;\r
- return true;\r
- }\r
\r
}\r