X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/daadfde6f22a79b23e74fd095f6ef8a38e846b96..d322af785f1ef80a40b657a0213d75ae6930401f:/src/gr/ebs/gss/client/FileList.java
diff --git a/src/gr/ebs/gss/client/FileList.java b/src/gr/ebs/gss/client/FileList.java
index 8c31104..efc664d 100644
--- a/src/gr/ebs/gss/client/FileList.java
+++ b/src/gr/ebs/gss/client/FileList.java
@@ -37,29 +37,31 @@ import java.util.Comparator;
import java.util.List;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.IncrementalCommand;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.SourcesTableEvents;
-import com.google.gwt.user.client.ui.TableListener;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
/**
* A composite that displays the list of files in a particular folder.
*/
-public class FileList extends Composite implements TableListener, ClickListener {
+public class FileList extends Composite implements ClickHandler {
private HTML prevButton = new HTML("< Previous", true);
@@ -91,79 +93,79 @@ public class FileList extends Composite implements TableListener, ClickListener
* Specifies that the images available for this composite will be the ones
* available in FileContextMenu.
*/
- public interface Images extends FileContextMenu.Images, Folders.Images {
+ public interface Images extends ClientBundle,FileContextMenu.Images, Folders.Images {
- @Resource("gr/ebs/gss/resources/blank.gif")
- AbstractImagePrototype blank();
+ @Source("gr/ebs/gss/resources/blank.gif")
+ ImageResource blank();
- @Resource("gr/ebs/gss/resources/asc.png")
- AbstractImagePrototype asc();
+ @Source("gr/ebs/gss/resources/asc.png")
+ ImageResource asc();
- @Resource("gr/ebs/gss/resources/desc.png")
- AbstractImagePrototype desc();
+ @Source("gr/ebs/gss/resources/desc.png")
+ ImageResource desc();
- @Resource("gr/ebs/gss/resources/mimetypes/document_shared.png")
- AbstractImagePrototype documentShared();
+ @Source("gr/ebs/gss/resources/mimetypes/document_shared.png")
+ ImageResource documentShared();
- @Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")
- AbstractImagePrototype wordprocessor();
+ @Source("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")
+ ImageResource wordprocessor();
- @Resource("gr/ebs/gss/resources/mimetypes/log.png")
- AbstractImagePrototype spreadsheet();
+ @Source("gr/ebs/gss/resources/mimetypes/log.png")
+ ImageResource spreadsheet();
- @Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")
- AbstractImagePrototype presentation();
+ @Source("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")
+ ImageResource presentation();
- @Resource("gr/ebs/gss/resources/mimetypes/acroread.png")
- AbstractImagePrototype pdf();
+ @Source("gr/ebs/gss/resources/mimetypes/acroread.png")
+ ImageResource pdf();
- @Resource("gr/ebs/gss/resources/mimetypes/image.png")
- AbstractImagePrototype image();
+ @Source("gr/ebs/gss/resources/mimetypes/image.png")
+ ImageResource image();
- @Resource("gr/ebs/gss/resources/mimetypes/video2.png")
- AbstractImagePrototype video();
+ @Source("gr/ebs/gss/resources/mimetypes/video2.png")
+ ImageResource video();
- @Resource("gr/ebs/gss/resources/mimetypes/knotify.png")
- AbstractImagePrototype audio();
+ @Source("gr/ebs/gss/resources/mimetypes/knotify.png")
+ ImageResource audio();
- @Resource("gr/ebs/gss/resources/mimetypes/html.png")
- AbstractImagePrototype html();
+ @Source("gr/ebs/gss/resources/mimetypes/html.png")
+ ImageResource html();
- @Resource("gr/ebs/gss/resources/mimetypes/txt.png")
- AbstractImagePrototype txt();
+ @Source("gr/ebs/gss/resources/mimetypes/txt.png")
+ ImageResource txt();
- @Resource("gr/ebs/gss/resources/mimetypes/ark2.png")
- AbstractImagePrototype zip();
+ @Source("gr/ebs/gss/resources/mimetypes/ark2.png")
+ ImageResource zip();
- @Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst_shared.png")
- AbstractImagePrototype wordprocessorShared();
+ @Source("gr/ebs/gss/resources/mimetypes/kcmfontinst_shared.png")
+ ImageResource wordprocessorShared();
- @Resource("gr/ebs/gss/resources/mimetypes/log_shared.png")
- AbstractImagePrototype spreadsheetShared();
+ @Source("gr/ebs/gss/resources/mimetypes/log_shared.png")
+ ImageResource spreadsheetShared();
- @Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr_shared.png")
- AbstractImagePrototype presentationShared();
+ @Source("gr/ebs/gss/resources/mimetypes/kpresenter_kpr_shared.png")
+ ImageResource presentationShared();
- @Resource("gr/ebs/gss/resources/mimetypes/acroread_shared.png")
- AbstractImagePrototype pdfShared();
+ @Source("gr/ebs/gss/resources/mimetypes/acroread_shared.png")
+ ImageResource pdfShared();
- @Resource("gr/ebs/gss/resources/mimetypes/image_shared.png")
- AbstractImagePrototype imageShared();
+ @Source("gr/ebs/gss/resources/mimetypes/image_shared.png")
+ ImageResource imageShared();
- @Resource("gr/ebs/gss/resources/mimetypes/video2_shared.png")
- AbstractImagePrototype videoShared();
+ @Source("gr/ebs/gss/resources/mimetypes/video2_shared.png")
+ ImageResource videoShared();
- @Resource("gr/ebs/gss/resources/mimetypes/knotify_shared.png")
- AbstractImagePrototype audioShared();
+ @Source("gr/ebs/gss/resources/mimetypes/knotify_shared.png")
+ ImageResource audioShared();
- @Resource("gr/ebs/gss/resources/mimetypes/html_shared.png")
- AbstractImagePrototype htmlShared();
+ @Source("gr/ebs/gss/resources/mimetypes/html_shared.png")
+ ImageResource htmlShared();
- @Resource("gr/ebs/gss/resources/mimetypes/txt_shared.png")
- AbstractImagePrototype txtShared();
+ @Source("gr/ebs/gss/resources/mimetypes/txt_shared.png")
+ ImageResource txtShared();
- @Resource("gr/ebs/gss/resources/mimetypes/ark2_shared.png")
- AbstractImagePrototype zipShared();
+ @Source("gr/ebs/gss/resources/mimetypes/ark2_shared.png")
+ ImageResource zipShared();
}
@@ -229,21 +231,25 @@ public class FileList extends Composite implements TableListener, ClickListener
public FileList(Images _images) {
images = _images;
- prevButton.addClickListener(this);
- nextButton.addClickListener(this);
+ prevButton.addClickHandler(this);
+ nextButton.addClickHandler(this);
- contextMenu = new DnDFocusPanel(new HTML(images.fileContextMenu().getHTML()));
- contextMenu.addClickListener(new FileContextMenu(images, false, false));
+ contextMenu = new DnDFocusPanel(new HTML(AbstractImagePrototype.create(images.fileContextMenu()).getHTML()));
+ contextMenu.addClickHandler(new FileContextMenu(images, false, false));
GSS.get().getDragController().makeDraggable(contextMenu);
// Setup the table.
table.setCellSpacing(0);
table.setCellPadding(2);
table.setWidth("100%");
+ table.addClickHandler(new ClickHandler() {
- // Hook up events.
- table.addTableListener(this);
-
+ @Override
+ public void onClick(ClickEvent event) {
+ Cell cell = table.getCellForEvent(event);
+ onRowClicked(cell.getRowIndex());
+ }
+ });
// Create the 'navigation' bar at the upper-right.
HorizontalPanel innerNavBar = new HorizontalPanel();
innerNavBar.setStyleName("gss-ListNavBar");
@@ -273,26 +279,28 @@ public class FileList extends Composite implements TableListener, ClickListener
GSS.preventIESelection();
}
- public void onClick(Widget sender) {
- if (sender == nextButton) {
+ @Override
+ public void onClick(ClickEvent event) {
+ if(event.getSource() == nextButton){
// Move forward a page.
clearSelectedRows();
startIndex += GSS.VISIBLE_FILE_COUNT;
if (startIndex >= folderFileCount)
startIndex -= GSS.VISIBLE_FILE_COUNT;
else
- update();
- } else if (sender == prevButton) {
+ update(false);
+ } else if (event.getSource() == prevButton) {
clearSelectedRows();
// Move back a page.
startIndex -= GSS.VISIBLE_FILE_COUNT;
if (startIndex < 0)
startIndex = 0;
else
- update();
+ update(false);
}
}
+
@Override
public void onBrowserEvent(Event event) {
if (files == null || files.size() == 0) {
@@ -354,7 +362,7 @@ public class FileList extends Composite implements TableListener, ClickListener
return DONE;
}
- public void onCellClicked(SourcesTableEvents sender, int row, int cell) {
+ private void onRowClicked(int row) {
// Select the row that was clicked (-1 to account for header row).
if (row > folderFileCount)
return;
@@ -400,56 +408,57 @@ public class FileList extends Composite implements TableListener, ClickListener
*/
private void initTable() {
nameLabel = new HTML("Name");
- nameLabel.addClickListener(new ClickListener() {
+ nameLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("name");
- update();
+
}
});
versionLabel = new HTML("Version");
- versionLabel.addClickListener(new ClickListener() {
+ versionLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("version");
- update();
}
});
sizeLabel = new HTML("Size");
- sizeLabel.addClickListener(new ClickListener() {
+ sizeLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("size");
- update();
}
});
- dateLabel = new HTML("Date");
- dateLabel.addClickListener(new ClickListener() {
+ dateLabel = new HTML("Last modified");
+ dateLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("date");
- update();
}
});
ownerLabel = new HTML("Owner");
- ownerLabel.addClickListener(new ClickListener() {
+ ownerLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("owner");
- update();
}
});
pathLabel = new HTML("Path");
- pathLabel.addClickListener(new ClickListener() {
+ pathLabel.addClickHandler(new ClickHandler() {
- public void onClick(Widget sender) {
+ @Override
+ public void onClick(ClickEvent event) {
sortFiles("path");
- update();
}
});
@@ -549,13 +558,73 @@ public class FileList extends Composite implements TableListener, ClickListener
/**
* Update the display of the file list.
*/
- void update() {
+ void update(boolean sort) {
int count = folderFileCount;
int max = startIndex + GSS.VISIBLE_FILE_COUNT;
if (max > count)
max = count;
folderTotalSize = 0;
+ if (sort && files != null && files.size() != 0) {
+ clearLabels();
+ clearSelectedRows();
+
+ Collections.sort(files, new Comparator() {
+
+ public int compare(FileResource arg0, FileResource arg1) {
+ AbstractImagePrototype descPrototype = AbstractImagePrototype.create(images.desc());
+ AbstractImagePrototype ascPrototype = AbstractImagePrototype.create(images.asc());
+ if (sortingType)
+ if (sortingProperty.equals("version")) {
+ versionLabel.setHTML("Version " + descPrototype.getHTML());
+ return arg0.getVersion().compareTo(arg1.getVersion());
+ } else if (sortingProperty.equals("owner")) {
+ ownerLabel.setHTML("Owner " + descPrototype.getHTML());
+ return arg0.getOwner().compareTo(arg1.getOwner());
+ } else if (sortingProperty.equals("date")) {
+ dateLabel.setHTML("Date modified " + descPrototype.getHTML());
+ return arg0.getModificationDate().compareTo(arg1.getModificationDate());
+ } else if (sortingProperty.equals("size")) {
+ sizeLabel.setHTML("Size " + descPrototype.getHTML());
+ return arg0.getContentLength().compareTo(arg1.getContentLength());
+ } else if (sortingProperty.equals("name")) {
+ nameLabel.setHTML("Name " + descPrototype.getHTML());
+ return arg0.getName().compareTo(arg1.getName());
+ } else if (sortingProperty.equals("path")) {
+ pathLabel.setHTML("Path " + descPrototype.getHTML());
+ return arg0.getUri().compareTo(arg1.getUri());
+ } else {
+ nameLabel.setHTML("Name " + descPrototype.getHTML());
+ return arg0.getName().compareTo(arg1.getName());
+ }
+ else if (sortingProperty.equals("version")) {
+ versionLabel.setHTML("Version " + ascPrototype.getHTML());
+ return arg1.getVersion().compareTo(arg0.getVersion());
+ } else if (sortingProperty.equals("owner")) {
+ ownerLabel.setHTML("Owner " + ascPrototype.getHTML());
+ return arg1.getOwner().compareTo(arg0.getOwner());
+ } else if (sortingProperty.equals("date")) {
+ dateLabel.setHTML("Date modified " + ascPrototype.getHTML());
+ return arg1.getModificationDate().compareTo(arg0.getModificationDate());
+ } else if (sortingProperty.equals("size")) {
+ sizeLabel.setHTML("Size " + ascPrototype.getHTML());
+ return arg1.getContentLength().compareTo(arg0.getContentLength());
+ } else if (sortingProperty.equals("name")) {
+ nameLabel.setHTML("Name " + ascPrototype.getHTML());
+ return arg1.getName().compareTo(arg0.getName());
+ } else if (sortingProperty.equals("path")) {
+ pathLabel.setHTML("Path " + ascPrototype.getHTML());
+ return arg1.getUri().compareTo(arg0.getUri());
+ } else {
+ nameLabel.setHTML("Name " + ascPrototype.getHTML());
+ return arg1.getName().compareTo(arg0.getName());
+ }
+ }
+
+ });
+ }
+
+
// Show the selected files.
int i = 1;
for (; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
@@ -571,10 +640,11 @@ public class FileList extends Composite implements TableListener, ClickListener
table.getRowFormatter().addStyleName(i, "gss-fileRow");
//add view image link for image files
- if (file.getContentType().startsWith("image/"))
+ String contentType = file.getContentType();
+ if (contentType.endsWith("png") || contentType.endsWith("gif") || contentType.endsWith("jpeg") )
table.setHTML(i, 1, file.getName() + " " +
"(view)" + "");
else
@@ -584,7 +654,7 @@ public class FileList extends Composite implements TableListener, ClickListener
table.setText(i, 4, String.valueOf(file.getVersion()));
table.setText(i, 5, String.valueOf(file.getFileSizeAsString()));
final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
- table.setText(i, 6, formatter.format(file.getCreationDate()));
+ table.setText(i, 6, formatter.format(file.getModificationDate()));
folderTotalSize += file.getContentLength();
}
@@ -631,33 +701,33 @@ public class FileList extends Composite implements TableListener, ClickListener
String mimetype = file.getContentType();
boolean shared = file.isShared();
if (mimetype == null)
- return shared ? images.documentShared() : images.document();
+ return shared ? AbstractImagePrototype.create(images.documentShared()) : AbstractImagePrototype.create(images.document());
mimetype = mimetype.toLowerCase();
if (mimetype.startsWith("application/pdf"))
- return shared ? images.pdfShared() : images.pdf();
+ return shared ? AbstractImagePrototype.create(images.pdfShared()) : AbstractImagePrototype.create(images.pdf());
else if (mimetype.endsWith("excel"))
- return shared ? images.spreadsheetShared() : images.spreadsheet();
+ return shared ? AbstractImagePrototype.create(images.spreadsheetShared()) : AbstractImagePrototype.create(images.spreadsheet());
else if (mimetype.endsWith("msword"))
- return shared ? images.wordprocessorShared() : images.wordprocessor();
+ return shared ? AbstractImagePrototype.create(images.wordprocessorShared()) : AbstractImagePrototype.create(images.wordprocessor());
else if (mimetype.endsWith("powerpoint"))
- return shared ? images.presentationShared() : images.presentation();
+ return shared ? AbstractImagePrototype.create(images.presentationShared()) : AbstractImagePrototype.create(images.presentation());
else if (mimetype.startsWith("application/zip") ||
mimetype.startsWith("application/gzip") ||
mimetype.startsWith("application/x-gzip") ||
mimetype.startsWith("application/x-tar") ||
mimetype.startsWith("application/x-gtar"))
- return shared ? images.zipShared() : images.zip();
+ return shared ? AbstractImagePrototype.create(images.zipShared()) : AbstractImagePrototype.create(images.zip());
else if (mimetype.startsWith("text/html"))
- return shared ? images.htmlShared() : images.html();
+ return shared ? AbstractImagePrototype.create(images.htmlShared()) : AbstractImagePrototype.create(images.html());
else if (mimetype.startsWith("text/plain"))
- return shared ? images.txtShared() : images.txt();
+ return shared ? AbstractImagePrototype.create(images.txtShared()) : AbstractImagePrototype.create(images.txt());
else if (mimetype.startsWith("image/"))
- return shared ? images.imageShared() : images.image();
+ return shared ? AbstractImagePrototype.create(images.imageShared()) : AbstractImagePrototype.create(images.image());
else if (mimetype.startsWith("video/"))
- return shared ? images.videoShared() : images.video();
+ return shared ? AbstractImagePrototype.create(images.videoShared()) : AbstractImagePrototype.create(images.video());
else if (mimetype.startsWith("audio/"))
- return shared ? images.audioShared() : images.audio();
- return shared ? images.documentShared() : images.document();
+ return shared ? AbstractImagePrototype.create(images.audioShared()) : AbstractImagePrototype.create(images.audio());
+ return shared ? AbstractImagePrototype.create(images.documentShared()) : AbstractImagePrototype.create(images.document());
}
/**
@@ -688,12 +758,16 @@ public class FileList extends Composite implements TableListener, ClickListener
}
public void updateFileCache(boolean updateSelectedFolder, final boolean clearSelection) {
+ updateFileCache(updateSelectedFolder, clearSelection, null);
+ }
+
+ public void updateFileCache(boolean updateSelectedFolder, final boolean clearSelection, final String newFilename) {
if (!updateSelectedFolder && !GSS.get().getFolders().getTrashItem().equals(GSS.get().getFolders().getCurrent()))
updateFileCache(clearSelection);
else if (GSS.get().getFolders().getCurrent() != null) {
final DnDTreeItem folderItem = (DnDTreeItem) GSS.get().getFolders().getCurrent();
if (folderItem.getFolderResource() != null) {
- update();
+ update(true);
GetCommand gf = new GetCommand(FolderResource.class, folderItem.getFolderResource().getUri()) {
@Override
@@ -719,7 +793,7 @@ public class FileList extends Composite implements TableListener, ClickListener
r.setUri(p.substring(0, indexOfQuestionMark));
}
folderItem.getFolderResource().setFiles(result);
- updateFileCache(clearSelection);
+ updateFileCache(clearSelection, newFilename);
}
@Override
@@ -738,7 +812,7 @@ public class FileList extends Composite implements TableListener, ClickListener
DeferredCommand.addCommand(getFiles);
}
else
- updateFileCache(clearSelection);
+ updateFileCache(clearSelection, newFilename);
}
@Override
@@ -775,7 +849,7 @@ public class FileList extends Composite implements TableListener, ClickListener
@Override
public void onComplete() {
folderItem.setUserObject(getResult());
- updateFileCache(clearSelection);
+ updateFileCache(clearSelection, newFilename);
}
@Override
@@ -791,7 +865,7 @@ public class FileList extends Composite implements TableListener, ClickListener
@Override
public void onComplete() {
folderItem.setUserObject(getResult());
- updateFileCache(clearSelection);
+ updateFileCache(clearSelection, newFilename);
}
@Override
@@ -806,24 +880,27 @@ public class FileList extends Composite implements TableListener, ClickListener
updateFileCache(clearSelection);
}
+ private void updateFileCache(boolean clearSelection) {
+ updateFileCache(clearSelection, null);
+ }
+
/**
* Update the file cache with data from the server.
*
* @param userId the ID of the current user
+ * @param newFilename the new name of the previously selected file,
+ * if a rename operation has taken place
*/
- private void updateFileCache(boolean clearSelection) {
+ private void updateFileCache(boolean clearSelection, String newFilename) {
if (clearSelection)
clearSelectedRows();
clearLabels();
- sortingProperty = "name";
- nameLabel.setHTML("Name " + images.desc().getHTML());
- sortingType = true;
startIndex = 0;
final TreeItem folderItem = GSS.get().getFolders().getCurrent();
// Validation.
if (folderItem == null || GSS.get().getFolders().isOthersShared(folderItem)) {
setFiles(new ArrayList());
- update();
+ update(true);
return;
}
if (folderItem instanceof DnDTreeItem) {
@@ -842,8 +919,23 @@ public class FileList extends Composite implements TableListener, ClickListener
setFiles(dnd.getOtherUserResource().getFiles());
else
setFiles(dnd.getFolderResource().getFiles());
-
- update();
+ update(true);
+
+ if (!clearSelection && selectedRows.size()==1 && newFilename!=null) {
+ int row = -1;
+ for (int i=1; i < GSS.VISIBLE_FILE_COUNT + 1; ++i) {
+ if (startIndex + i > folderFileCount)
+ break;
+ FileResource file = files.get(startIndex + i - 1);
+ if (newFilename.equals(file.getName())) {
+ row = i-1;
+ break;
+ }
+ }
+ clearSelectedRows();
+ if (row!=-1)
+ selectRow(row);
+ }
}
}
@@ -875,68 +967,14 @@ public class FileList extends Composite implements TableListener, ClickListener
sortingProperty = sortProperty;
sortingType = true;
}
- clearLabels();
- clearSelectedRows();
- if (files == null || files.size() == 0)
- return;
- Collections.sort(files, new Comparator() {
-
- public int compare(FileResource arg0, FileResource arg1) {
- if (sortingType)
- if (sortProperty.equals("version")) {
- versionLabel.setHTML("Version " + images.desc().getHTML());
- return new Integer(arg0.getVersion()).compareTo(new Integer(arg1.getVersion()));
- } else if (sortProperty.equals("owner")) {
- ownerLabel.setHTML("Owner " + images.desc().getHTML());
- return new Integer(arg0.getOwner()).compareTo(new Integer(arg1.getOwner()));
- } else if (sortProperty.equals("date")) {
- dateLabel.setHTML("Date " + images.desc().getHTML());
- return arg0.getCreationDate().compareTo(arg1.getCreationDate());
- } else if (sortProperty.equals("size")) {
- sizeLabel.setHTML("Size " + images.desc().getHTML());
- return new Long(arg0.getContentLength()).compareTo(new Long(arg1.getContentLength()));
- } else if (sortProperty.equals("name")) {
- nameLabel.setHTML("Name " + images.desc().getHTML());
- return arg0.getName().compareTo(arg1.getName());
- } else if (sortProperty.equals("path")) {
- pathLabel.setHTML("Path " + images.desc().getHTML());
- return arg0.getUri().compareTo(arg1.getUri());
- } else {
- nameLabel.setHTML("Name " + images.desc().getHTML());
- return arg0.getName().compareTo(arg1.getName());
- }
- else if (sortProperty.equals("version")) {
- versionLabel.setHTML("Version " + images.asc().getHTML());
- return new Integer(arg1.getVersion()).compareTo(new Integer(arg0.getVersion()));
- } else if (sortProperty.equals("owner")) {
- ownerLabel.setHTML("Owner " + images.asc().getHTML());
- return new Integer(arg1.getOwner()).compareTo(new Integer(arg0.getOwner()));
- } else if (sortProperty.equals("date")) {
- dateLabel.setHTML("Date " + images.asc().getHTML());
- return arg1.getCreationDate().compareTo(arg0.getCreationDate());
- } else if (sortProperty.equals("size")) {
- sizeLabel.setHTML("Size " + images.asc().getHTML());
- return new Long(arg1.getContentLength()).compareTo(new Long(arg0.getContentLength()));
- } else if (sortProperty.equals("name")) {
- nameLabel.setHTML("Name " + images.asc().getHTML());
- return arg1.getName().compareTo(arg0.getName());
- } else if (sortProperty.equals("path")) {
- pathLabel.setHTML("Path " + images.asc().getHTML());
- return arg1.getUri().compareTo(arg0.getUri());
- } else {
- nameLabel.setHTML("Name " + images.asc().getHTML());
- return arg1.getName().compareTo(arg0.getName());
- }
- }
-
- });
+ update(true);
}
private void clearLabels() {
nameLabel.setText("Name");
versionLabel.setText("Version");
sizeLabel.setText("Size");
- dateLabel.setText("Date");
+ dateLabel.setText("Last modified");
ownerLabel.setText("Owner");
pathLabel.setText("Path");
}
@@ -1019,4 +1057,6 @@ public class FileList extends Composite implements TableListener, ClickListener
return -1;
}
+
+
}