package gr.ebs.gss.client;\r
\r
import gr.ebs.gss.client.FilePropertiesDialog.Images;\r
-import gr.ebs.gss.client.dnd.DnDTreeItem;\r
import gr.ebs.gss.client.rest.PostCommand;\r
import gr.ebs.gss.client.rest.RestException;\r
import gr.ebs.gss.client.rest.resource.FolderResource;\r
import gr.ebs.gss.client.rest.resource.GroupResource;\r
import gr.ebs.gss.client.rest.resource.PermissionHolder;\r
+import gr.ebs.gss.client.rest.resource.RestResource;\r
+import gr.ebs.gss.client.rest.resource.RestResourceWrapper;\r
\r
import java.util.List;\r
import java.util.Set;\r
\r
import com.google.gwt.core.client.GWT;\r
import com.google.gwt.dom.client.NativeEvent;\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.KeyCodes;\r
-import com.google.gwt.event.dom.client.KeyDownEvent;\r
-import com.google.gwt.event.dom.client.KeyDownHandler;\r
import com.google.gwt.http.client.URL;\r
import com.google.gwt.i18n.client.DateTimeFormat;\r
import com.google.gwt.json.client.JSONArray;\r
GSS.enableIESelection();\r
\r
create = _create;\r
- DnDTreeItem folderItem = (DnDTreeItem)GSS.get().getFolders().getCurrent();\r
- folder = folderItem.getFolderResource();\r
+ \r
+ folder = ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource();\r
permList = new PermissionsList(images, folder.getPermissions(), folder.getOwner());\r
groups = _groups;\r
\r
generalTable.setText(2, 0, "Creator");\r
generalTable.setText(3, 0, "Last modified");\r
folderName.setText(create ? "" : folder.getName());\r
+ folderName.getElement().setId("folderPropertiesDialog.textBox.name");\r
generalTable.setWidget(0, 1, folderName);\r
- folderName.addKeyDownHandler(new KeyDownHandler() {\r
-\r
+ folderName.addChangeHandler(new ChangeHandler() {\r
+ \r
@Override\r
- public void onKeyDown(KeyDownEvent event) {\r
- folderNameNote.setVisible(true);\r
-\r
+ public void onChange(ChangeEvent event) {\r
+ if(folderName.getText().contains("/"))\r
+ folderNameNote.setVisible(true);\r
+ else\r
+ folderNameNote.setVisible(false); \r
+ \r
}\r
});\r
\r
+\r
if (create)\r
generalTable.setText(1, 1, folder.getName());\r
else if(folder.getParentName() == null)\r
okLabel = "Update";\r
Button ok = new Button(okLabel, new ClickHandler() {\r
@Override\r
- public void onClick(ClickEvent event) {\r
-\r
- createOrUpdateFolder();\r
+ public void onClick(ClickEvent event) { \r
+ if(folderName.getText().contains("/"))\r
+ folderNameNote.setVisible(true);\r
+ else {\r
+ folderNameNote.setVisible(false);\r
+ createOrUpdateFolder();\r
+ closeDialog();\r
+ }\r
\r
- closeDialog();\r
}\r
});\r
+ ok.getElement().setId("folderPropertiesDialog.button.ok");\r
buttons.add(ok);\r
buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);\r
// Create the 'Cancel' button, along with a listener that hides the\r
closeDialog();\r
}\r
});\r
+ cancel.getElement().setId("folderPropertiesDialog.button.cancel");\r
buttons.add(cancel);\r
buttons.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_CENTER);\r
buttons.setSpacing(8);\r
\r
@Override\r
public void onComplete() {\r
- GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+ //TODO:CELLTREE\r
+ GSS.get().getTreeView().updateNodeChildren((RestResourceWrapper) GSS.get().getTreeView().getSelection());\r
+ //GSS.get().getFolders().updateFolder((DnDTreeItem) GSS.get().getFolders().getCurrent());\r
}\r
\r
@Override\r
\r
@Override\r
public void onComplete() {\r
+ //TODO:CELLTREE\r
+ \r
if(getPostBody() != null && !"".equals(getPostBody().trim())){\r
- DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();\r
- FolderResource fres = folderItem.getFolderResource();\r
+ \r
+ \r
+ FolderResource fres = ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource();\r
String initialPath = fres.getUri();\r
String newPath = getPostBody().trim();\r
fres.setUri(newPath);\r
-\r
+ ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).getResource().setUri(newPath);\r
+ ((RestResourceWrapper) GSS.get().getTreeView().getSelection()).setUri(newPath);\r
+ GSS.get().getTreeView().updateNodeChildren(fres.getParentURI());\r
+ /*\r
if(folderItem.getParentItem() != null && ((DnDTreeItem)folderItem.getParentItem()).getFolderResource() != null){\r
((DnDTreeItem)folderItem.getParentItem()).getFolderResource().removeSubfolderPath(initialPath);\r
((DnDTreeItem)folderItem.getParentItem()).getFolderResource().getSubfolderPaths().add(newPath);\r
- }\r
+ }*/\r
}\r
- GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+ //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+ \r
GSS.get().showFileList(true);\r
}\r
\r
}\r
else\r
GSS.get().displayError("System error moifying file: "+t.getMessage());\r
- GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
+ //TODO:CELLTREE\r
+ //GSS.get().getFolders().updateFolder( (DnDTreeItem) GSS.get().getFolders().getCurrent());\r
}\r
};\r
DeferredCommand.addCommand(ep);\r