*/\r
package gr.ebs.gss.client;\r
\r
-import gr.ebs.gss.client.dnd.DnDFocusPanel;\r
+import gr.ebs.gss.client.dnd.DnDSimpleFocusPanel;\r
import gr.ebs.gss.client.dnd.DnDTreeItem;\r
import gr.ebs.gss.client.rest.GetCommand;\r
import gr.ebs.gss.client.rest.MultipleHeadCommand;\r
import java.util.List;\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.ClickEvent;\r
+import com.google.gwt.event.dom.client.ClickHandler;\r
import com.google.gwt.http.client.URL;\r
import com.google.gwt.i18n.client.DateTimeFormat;\r
+import com.google.gwt.resources.client.ClientBundle;\r
+import com.google.gwt.resources.client.ImageResource;\r
import com.google.gwt.user.client.DOM;\r
import com.google.gwt.user.client.DeferredCommand;\r
import com.google.gwt.user.client.Event;\r
import com.google.gwt.user.client.IncrementalCommand;\r
import com.google.gwt.user.client.Window;\r
import com.google.gwt.user.client.ui.AbstractImagePrototype;\r
-import com.google.gwt.user.client.ui.ClickListener;\r
import com.google.gwt.user.client.ui.Composite;\r
import com.google.gwt.user.client.ui.Grid;\r
import com.google.gwt.user.client.ui.HTML;\r
import com.google.gwt.user.client.ui.HasHorizontalAlignment;\r
import com.google.gwt.user.client.ui.HorizontalPanel;\r
-import com.google.gwt.user.client.ui.SourcesTableEvents;\r
-import com.google.gwt.user.client.ui.TableListener;\r
import com.google.gwt.user.client.ui.TreeItem;\r
import com.google.gwt.user.client.ui.Widget;\r
+import com.google.gwt.user.client.ui.HTMLTable.Cell;\r
\r
/**\r
* A composite that displays the list of files in a particular folder.\r
*/\r
-public class FileList extends Composite implements TableListener, ClickListener {\r
+public class FileList extends Composite implements ClickHandler {\r
\r
private HTML prevButton = new HTML("<a href='javascript:;'>< Previous</a>", true);\r
\r
/**\r
* The context menu for the selected file.\r
*/\r
- final DnDFocusPanel contextMenu;\r
+ final DnDSimpleFocusPanel contextMenu;\r
\r
/**\r
* Specifies that the images available for this composite will be the ones\r
* available in FileContextMenu.\r
*/\r
- public interface Images extends FileContextMenu.Images, Folders.Images {\r
+ public interface Images extends ClientBundle,FileContextMenu.Images, Folders.Images {\r
\r
- @Resource("gr/ebs/gss/resources/blank.gif")\r
- AbstractImagePrototype blank();\r
+ @Source("gr/ebs/gss/resources/blank.gif")\r
+ ImageResource blank();\r
\r
- @Resource("gr/ebs/gss/resources/asc.png")\r
- AbstractImagePrototype asc();\r
+ @Source("gr/ebs/gss/resources/asc.png")\r
+ ImageResource asc();\r
\r
- @Resource("gr/ebs/gss/resources/desc.png")\r
- AbstractImagePrototype desc();\r
+ @Source("gr/ebs/gss/resources/desc.png")\r
+ ImageResource desc();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/document_shared.png")\r
- AbstractImagePrototype documentShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/document_shared.png")\r
+ ImageResource documentShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")\r
- AbstractImagePrototype wordprocessor();\r
+ @Source("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")\r
+ ImageResource wordprocessor();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/log.png")\r
- AbstractImagePrototype spreadsheet();\r
+ @Source("gr/ebs/gss/resources/mimetypes/log.png")\r
+ ImageResource spreadsheet();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")\r
- AbstractImagePrototype presentation();\r
+ @Source("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")\r
+ ImageResource presentation();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/acroread.png")\r
- AbstractImagePrototype pdf();\r
+ @Source("gr/ebs/gss/resources/mimetypes/acroread.png")\r
+ ImageResource pdf();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/image.png")\r
- AbstractImagePrototype image();\r
+ @Source("gr/ebs/gss/resources/mimetypes/image.png")\r
+ ImageResource image();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/video2.png")\r
- AbstractImagePrototype video();\r
+ @Source("gr/ebs/gss/resources/mimetypes/video2.png")\r
+ ImageResource video();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/knotify.png")\r
- AbstractImagePrototype audio();\r
+ @Source("gr/ebs/gss/resources/mimetypes/knotify.png")\r
+ ImageResource audio();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/html.png")\r
- AbstractImagePrototype html();\r
+ @Source("gr/ebs/gss/resources/mimetypes/html.png")\r
+ ImageResource html();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/txt.png")\r
- AbstractImagePrototype txt();\r
+ @Source("gr/ebs/gss/resources/mimetypes/txt.png")\r
+ ImageResource txt();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/ark2.png")\r
- AbstractImagePrototype zip();\r
+ @Source("gr/ebs/gss/resources/mimetypes/ark2.png")\r
+ ImageResource zip();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst_shared.png")\r
- AbstractImagePrototype wordprocessorShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/kcmfontinst_shared.png")\r
+ ImageResource wordprocessorShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/log_shared.png")\r
- AbstractImagePrototype spreadsheetShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/log_shared.png")\r
+ ImageResource spreadsheetShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr_shared.png")\r
- AbstractImagePrototype presentationShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/kpresenter_kpr_shared.png")\r
+ ImageResource presentationShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/acroread_shared.png")\r
- AbstractImagePrototype pdfShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/acroread_shared.png")\r
+ ImageResource pdfShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/image_shared.png")\r
- AbstractImagePrototype imageShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/image_shared.png")\r
+ ImageResource imageShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/video2_shared.png")\r
- AbstractImagePrototype videoShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/video2_shared.png")\r
+ ImageResource videoShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/knotify_shared.png")\r
- AbstractImagePrototype audioShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/knotify_shared.png")\r
+ ImageResource audioShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/html_shared.png")\r
- AbstractImagePrototype htmlShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/html_shared.png")\r
+ ImageResource htmlShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/txt_shared.png")\r
- AbstractImagePrototype txtShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/txt_shared.png")\r
+ ImageResource txtShared();\r
\r
- @Resource("gr/ebs/gss/resources/mimetypes/ark2_shared.png")\r
- AbstractImagePrototype zipShared();\r
+ @Source("gr/ebs/gss/resources/mimetypes/ark2_shared.png")\r
+ ImageResource zipShared();\r
\r
}\r
\r
/**\r
* The table widget with the file list.\r
*/\r
- private Grid table = new Grid(GSS.VISIBLE_FILE_COUNT + 1, 8);\r
+ private FileTable table = new FileTable(GSS.VISIBLE_FILE_COUNT + 1, 8);\r
\r
/**\r
* The navigation bar for paginating the results.\r
public FileList(Images _images) {\r
images = _images;\r
\r
- prevButton.addClickListener(this);\r
- nextButton.addClickListener(this);\r
+ prevButton.addClickHandler(this);\r
+ nextButton.addClickHandler(this);\r
\r
- contextMenu = new DnDFocusPanel(new HTML(images.fileContextMenu().getHTML()));\r
- contextMenu.addClickListener(new FileContextMenu(images, false, false));\r
+ contextMenu = new DnDSimpleFocusPanel(new HTML(AbstractImagePrototype.create(images.fileContextMenu()).getHTML()));\r
+ contextMenu.addClickHandler(new FileContextMenu(images, false, false));\r
GSS.get().getDragController().makeDraggable(contextMenu);\r
\r
// Setup the table.\r
table.setCellSpacing(0);\r
table.setCellPadding(2);\r
table.setWidth("100%");\r
+ table.addClickHandler(new ClickHandler() {\r
\r
- // Hook up events.\r
- table.addTableListener(this);\r
-\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
+ Cell cell = table.getCellForEvent(event);\r
+ GWT.log("row clicked:"+cell.getRowIndex(), null);\r
+ onRowClicked(cell.getRowIndex(), true);\r
+ }\r
+ });\r
// Create the 'navigation' bar at the upper-right.\r
HorizontalPanel innerNavBar = new HorizontalPanel();\r
innerNavBar.setStyleName("gss-ListNavBar");\r
});\r
sinkEvents(Event.ONCONTEXTMENU);\r
sinkEvents(Event.ONMOUSEUP);\r
+ sinkEvents(Event.ONMOUSEDOWN);\r
sinkEvents(Event.ONCLICK);\r
sinkEvents(Event.ONKEYDOWN);\r
sinkEvents(Event.ONDBLCLICK);\r
GSS.preventIESelection();\r
}\r
\r
- public void onClick(Widget sender) {\r
- if (sender == nextButton) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
+ if(event.getSource() == nextButton){\r
// Move forward a page.\r
clearSelectedRows();\r
startIndex += GSS.VISIBLE_FILE_COUNT;\r
startIndex -= GSS.VISIBLE_FILE_COUNT;\r
else\r
update(false);\r
- } else if (sender == prevButton) {\r
+ } else if (event.getSource() == prevButton) {\r
clearSelectedRows();\r
// Move back a page.\r
startIndex -= GSS.VISIBLE_FILE_COUNT;\r
}\r
}\r
\r
+\r
@Override\r
public void onBrowserEvent(Event event) {\r
+ if (DOM.eventGetType(event) == Event.ONMOUSEDOWN && DOM.eventGetButton(event) == NativeEvent.BUTTON_RIGHT){\r
+ if (DOM.eventGetCtrlKey(event))\r
+ clickControl = true;\r
+ else\r
+ clickControl = false;\r
+ if (DOM.eventGetShiftKey(event)) {\r
+ clickShift = true;\r
+ if (selectedRows.size() == 1)\r
+ firstShift = selectedRows.get(0) - startIndex;\r
+ //event.preventDefault();\r
+ } else {\r
+ clickShift = false;\r
+ firstShift = -1;\r
+ //event.preventDefault();\r
+ }\r
+ int ri = table.getRowForEvent2(event);\r
+ if(ri != -1)\r
+ if(!selectedRows.contains(ri-1))\r
+ onRowClicked(ri, false);\r
+ }\r
+\r
if (files == null || files.size() == 0) {\r
if (DOM.eventGetType(event) == Event.ONCONTEXTMENU && selectedRows.size() == 0) {\r
FileContextMenu fm = new FileContextMenu(images, false, true);\r
String resource = file.getUri().substring(app.getApiPath().length() - 1, file.getUri().length());\r
String sig = app.getCurrentUserResource().getUsername() + " " +\r
RestCommand.calculateSig("GET", dateString, resource,\r
- RestCommand.base64decode(app.getToken()));\r
+ RestCommand.base64decode(app.getToken().replaceAll(" ", "+")));\r
Window.open(file.getUri() + "?Authorization=" + URL.encodeComponent(sig) + "&Date=" + URL.encodeComponent(dateString), "_blank", "");\r
event.preventDefault();\r
return;\r
clickShift = true;\r
if (selectedRows.size() == 1)\r
firstShift = selectedRows.get(0) - startIndex;\r
- event.preventDefault();\r
+ //event.preventDefault();\r
} else {\r
clickShift = false;\r
firstShift = -1;\r
- event.preventDefault();\r
+ //event.preventDefault();\r
}\r
}\r
super.onBrowserEvent(event);\r
return DONE;\r
}\r
\r
- public void onCellClicked(SourcesTableEvents sender, int row, int cell) {\r
+ private void onRowClicked(int row, boolean toggleSelection) {\r
// Select the row that was clicked (-1 to account for header row).\r
if (row > folderFileCount)\r
return;\r
contextMenu.setFiles(getSelectedFiles());\r
}\r
} else if (row > 0)\r
- selectRow(row - 1);\r
+ selectRow(row - 1, toggleSelection);\r
}\r
\r
/**\r
*/\r
private void initTable() {\r
nameLabel = new HTML("Name");\r
- nameLabel.addClickListener(new ClickListener() {\r
+ nameLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("name");\r
+\r
}\r
\r
});\r
versionLabel = new HTML("Version");\r
- versionLabel.addClickListener(new ClickListener() {\r
+ versionLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("version");\r
}\r
\r
});\r
sizeLabel = new HTML("Size");\r
- sizeLabel.addClickListener(new ClickListener() {\r
+ sizeLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("size");\r
}\r
\r
});\r
dateLabel = new HTML("Last modified");\r
- dateLabel.addClickListener(new ClickListener() {\r
+ dateLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("date");\r
}\r
\r
});\r
ownerLabel = new HTML("Owner");\r
- ownerLabel.addClickListener(new ClickListener() {\r
+ ownerLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("owner");\r
}\r
\r
});\r
pathLabel = new HTML("Path");\r
- pathLabel.addClickListener(new ClickListener() {\r
+ pathLabel.addClickHandler(new ClickHandler() {\r
\r
- public void onClick(Widget sender) {\r
+ @Override\r
+ public void onClick(ClickEvent event) {\r
sortFiles("path");\r
}\r
\r
*\r
* @param row the row to be selected\r
*/\r
- private void selectRow(final int row) {\r
+ private void selectRow(final int row, boolean toggleSelection) {\r
if (row < folderFileCount) {\r
if (clickControl)\r
- if (selectedRows.contains(row)) {\r
+ if (selectedRows.contains(row) && toggleSelection) {\r
int i = selectedRows.indexOf(startIndex + row);\r
selectedRows.remove(i);\r
styleRow(row, false);\r
selectedRows.add(startIndex + row);\r
styleRow(row, true);\r
}\r
- else if (selectedRows.size() == 1 && selectedRows.contains(row)){\r
+ else if (selectedRows.size() == 1 && selectedRows.contains(row) && toggleSelection){\r
clearSelectedRows();\r
return;\r
}\r
Collections.sort(files, new Comparator<FileResource>() {\r
\r
public int compare(FileResource arg0, FileResource arg1) {\r
+ AbstractImagePrototype descPrototype = AbstractImagePrototype.create(images.desc());\r
+ AbstractImagePrototype ascPrototype = AbstractImagePrototype.create(images.asc());\r
if (sortingType)\r
if (sortingProperty.equals("version")) {\r
- versionLabel.setHTML("Version " + images.desc().getHTML());\r
+ versionLabel.setHTML("Version " + descPrototype.getHTML());\r
return arg0.getVersion().compareTo(arg1.getVersion());\r
} else if (sortingProperty.equals("owner")) {\r
- ownerLabel.setHTML("Owner " + images.desc().getHTML());\r
+ ownerLabel.setHTML("Owner " + descPrototype.getHTML());\r
return arg0.getOwner().compareTo(arg1.getOwner());\r
} else if (sortingProperty.equals("date")) {\r
- dateLabel.setHTML("Date modified " + images.desc().getHTML());\r
+ dateLabel.setHTML("Date modified " + descPrototype.getHTML());\r
return arg0.getModificationDate().compareTo(arg1.getModificationDate());\r
} else if (sortingProperty.equals("size")) {\r
- sizeLabel.setHTML("Size " + images.desc().getHTML());\r
+ sizeLabel.setHTML("Size " + descPrototype.getHTML());\r
return arg0.getContentLength().compareTo(arg1.getContentLength());\r
} else if (sortingProperty.equals("name")) {\r
- nameLabel.setHTML("Name " + images.desc().getHTML());\r
+ nameLabel.setHTML("Name " + descPrototype.getHTML());\r
return arg0.getName().compareTo(arg1.getName());\r
} else if (sortingProperty.equals("path")) {\r
- pathLabel.setHTML("Path " + images.desc().getHTML());\r
+ pathLabel.setHTML("Path " + descPrototype.getHTML());\r
return arg0.getUri().compareTo(arg1.getUri());\r
} else {\r
- nameLabel.setHTML("Name " + images.desc().getHTML());\r
+ nameLabel.setHTML("Name " + descPrototype.getHTML());\r
return arg0.getName().compareTo(arg1.getName());\r
}\r
else if (sortingProperty.equals("version")) {\r
- versionLabel.setHTML("Version " + images.asc().getHTML());\r
+ versionLabel.setHTML("Version " + ascPrototype.getHTML());\r
return arg1.getVersion().compareTo(arg0.getVersion());\r
} else if (sortingProperty.equals("owner")) {\r
- ownerLabel.setHTML("Owner " + images.asc().getHTML());\r
+ ownerLabel.setHTML("Owner " + ascPrototype.getHTML());\r
return arg1.getOwner().compareTo(arg0.getOwner());\r
} else if (sortingProperty.equals("date")) {\r
- dateLabel.setHTML("Date modified " + images.asc().getHTML());\r
+ dateLabel.setHTML("Date modified " + ascPrototype.getHTML());\r
return arg1.getModificationDate().compareTo(arg0.getModificationDate());\r
} else if (sortingProperty.equals("size")) {\r
- sizeLabel.setHTML("Size " + images.asc().getHTML());\r
+ sizeLabel.setHTML("Size " + ascPrototype.getHTML());\r
return arg1.getContentLength().compareTo(arg0.getContentLength());\r
} else if (sortingProperty.equals("name")) {\r
- nameLabel.setHTML("Name " + images.asc().getHTML());\r
+ nameLabel.setHTML("Name " + ascPrototype.getHTML());\r
return arg1.getName().compareTo(arg0.getName());\r
} else if (sortingProperty.equals("path")) {\r
- pathLabel.setHTML("Path " + images.asc().getHTML());\r
+ pathLabel.setHTML("Path " + ascPrototype.getHTML());\r
return arg1.getUri().compareTo(arg0.getUri());\r
} else {\r
- nameLabel.setHTML("Name " + images.asc().getHTML());\r
+ nameLabel.setHTML("Name " + ascPrototype.getHTML());\r
return arg1.getName().compareTo(arg0.getName());\r
}\r
}\r
*/\r
private AbstractImagePrototype getFileIcon(FileResource file) {\r
String mimetype = file.getContentType();\r
- boolean shared = file.isShared();\r
+ boolean shared=false;\r
+ Folders folders = GSS.get().getFolders();\r
+ if(folders.getCurrent() != null && folders.isOthersSharedItem(folders.getCurrent())){\r
+ DnDTreeItem otherUser = (DnDTreeItem) folders.getUserOfSharedItem(folders.getCurrent());\r
+ if(otherUser==null)\r
+ shared = false;\r
+ else{\r
+ String uname = otherUser.getOtherUserResource().getUsername();\r
+ if(uname==null)\r
+ uname = ((DnDTreeItem)folders.getSharesItem()).getOthersResource().getUsernameOfUri(otherUser.getOtherUserResource().getUri());\r
+ if(uname != null)\r
+ shared = file.isShared();\r
+ }\r
+ }\r
+ else\r
+ shared = file.isShared();\r
if (mimetype == null)\r
- return shared ? images.documentShared() : images.document();\r
+ return shared ? AbstractImagePrototype.create(images.documentShared()) : AbstractImagePrototype.create(images.document());\r
mimetype = mimetype.toLowerCase();\r
if (mimetype.startsWith("application/pdf"))\r
- return shared ? images.pdfShared() : images.pdf();\r
+ return shared ? AbstractImagePrototype.create(images.pdfShared()) : AbstractImagePrototype.create(images.pdf());\r
else if (mimetype.endsWith("excel"))\r
- return shared ? images.spreadsheetShared() : images.spreadsheet();\r
+ return shared ? AbstractImagePrototype.create(images.spreadsheetShared()) : AbstractImagePrototype.create(images.spreadsheet());\r
else if (mimetype.endsWith("msword"))\r
- return shared ? images.wordprocessorShared() : images.wordprocessor();\r
+ return shared ? AbstractImagePrototype.create(images.wordprocessorShared()) : AbstractImagePrototype.create(images.wordprocessor());\r
else if (mimetype.endsWith("powerpoint"))\r
- return shared ? images.presentationShared() : images.presentation();\r
+ return shared ? AbstractImagePrototype.create(images.presentationShared()) : AbstractImagePrototype.create(images.presentation());\r
else if (mimetype.startsWith("application/zip") ||\r
mimetype.startsWith("application/gzip") ||\r
mimetype.startsWith("application/x-gzip") ||\r
mimetype.startsWith("application/x-tar") ||\r
mimetype.startsWith("application/x-gtar"))\r
- return shared ? images.zipShared() : images.zip();\r
+ return shared ? AbstractImagePrototype.create(images.zipShared()) : AbstractImagePrototype.create(images.zip());\r
else if (mimetype.startsWith("text/html"))\r
- return shared ? images.htmlShared() : images.html();\r
+ return shared ? AbstractImagePrototype.create(images.htmlShared()) : AbstractImagePrototype.create(images.html());\r
else if (mimetype.startsWith("text/plain"))\r
- return shared ? images.txtShared() : images.txt();\r
+ return shared ? AbstractImagePrototype.create(images.txtShared()) : AbstractImagePrototype.create(images.txt());\r
else if (mimetype.startsWith("image/"))\r
- return shared ? images.imageShared() : images.image();\r
+ return shared ? AbstractImagePrototype.create(images.imageShared()) : AbstractImagePrototype.create(images.image());\r
else if (mimetype.startsWith("video/"))\r
- return shared ? images.videoShared() : images.video();\r
+ return shared ? AbstractImagePrototype.create(images.videoShared()) : AbstractImagePrototype.create(images.video());\r
else if (mimetype.startsWith("audio/"))\r
- return shared ? images.audioShared() : images.audio();\r
- return shared ? images.documentShared() : images.document();\r
+ return shared ? AbstractImagePrototype.create(images.audioShared()) : AbstractImagePrototype.create(images.audio());\r
+ return shared ? AbstractImagePrototype.create(images.documentShared()) : AbstractImagePrototype.create(images.document());\r
}\r
\r
/**\r
updateFileCache(clearSelection);\r
else if (GSS.get().getFolders().getCurrent() != null) {\r
final DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();\r
- if (folderItem.getFolderResource() != null) {\r
+ if(GSS.get().getFolders().isFileItem(folderItem) || GSS.get().getFolders().isMySharedItem(folderItem) || GSS.get().getFolders().isOthersSharedItem(folderItem)){\r
update(true);\r
- GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, folderItem.getFolderResource().getUri()) {\r
+ GetCommand<FolderResource> gf = new GetCommand<FolderResource>(FolderResource.class, folderItem.getFolderResource().getUri(),folderItem.getFolderResource()) {\r
\r
@Override\r
public void onComplete() {\r
filePaths[c] = fpath + "?" + Math.random();\r
c++;\r
}\r
- MultipleHeadCommand<FileResource> getFiles = new MultipleHeadCommand<FileResource>(FileResource.class, filePaths){\r
+ MultipleHeadCommand<FileResource> getFiles = new MultipleHeadCommand<FileResource>(FileResource.class, filePaths, folderItem.getFolderResource().getFileCache()){\r
\r
@Override\r
public void onComplete(){\r
int indexOfQuestionMark = p.lastIndexOf('?');\r
if(indexOfQuestionMark>0)\r
r.setUri(p.substring(0, indexOfQuestionMark));\r
+ GWT.log("FETCHED:"+r.getLastModifiedSince(), null);\r
}\r
folderItem.getFolderResource().setFiles(result);\r
+ folderItem.getFolderResource().setFilesExpanded(true);\r
updateFileCache(clearSelection, newFilename);\r
}\r
\r
};\r
DeferredCommand.addCommand(gf);\r
} else if (folderItem.getTrashResource() != null) {\r
- GetCommand<TrashResource> gt = new GetCommand<TrashResource>(TrashResource.class, folderItem.getTrashResource().getUri()) {\r
+ GetCommand<TrashResource> gt = new GetCommand<TrashResource>(TrashResource.class, folderItem.getTrashResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r
};\r
DeferredCommand.addCommand(gt);\r
} else if (folderItem.getSharedResource() != null) {\r
- GetCommand<SharedResource> gt = new GetCommand<SharedResource>(SharedResource.class, folderItem.getSharedResource().getUri()) {\r
+ GetCommand<SharedResource> gt = new GetCommand<SharedResource>(SharedResource.class, folderItem.getSharedResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r
};\r
DeferredCommand.addCommand(gt);\r
} else if (folderItem.getOtherUserResource() != null) {\r
- GetCommand<OtherUserResource> gt = new GetCommand<OtherUserResource>(OtherUserResource.class, folderItem.getOtherUserResource().getUri()) {\r
+ GetCommand<OtherUserResource> gt = new GetCommand<OtherUserResource>(OtherUserResource.class, folderItem.getOtherUserResource().getUri(), null) {\r
\r
@Override\r
public void onComplete() {\r
}\r
clearSelectedRows();\r
if (row!=-1)\r
- selectRow(row);\r
+ selectRow(row, true);\r
}\r
}\r
}\r
return -1;\r
}\r
\r
+\r
+\r
}\r