Revision 10791b56 web_client/src/gr/grnet/pithos/web/client/FileList.java
b/web_client/src/gr/grnet/pithos/web/client/FileList.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
package gr.grnet.pithos.web.client; |
37 | 37 |
|
38 |
import com.google.gwt.event.dom.client.ContextMenuEvent; |
|
39 |
import com.google.gwt.event.dom.client.ContextMenuHandler; |
|
40 |
|
|
41 |
import com.google.gwt.user.cellview.client.Column; |
|
42 |
import gr.grnet.pithos.web.client.commands.UploadFileCommand; |
|
43 | 38 |
import gr.grnet.pithos.web.client.foldertree.File; |
44 | 39 |
import gr.grnet.pithos.web.client.foldertree.Folder; |
45 | 40 |
import gr.grnet.pithos.web.client.foldertree.FolderTreeView; |
... | ... | |
55 | 50 |
import com.google.gwt.cell.client.TextCell; |
56 | 51 |
import com.google.gwt.cell.client.ValueUpdater; |
57 | 52 |
import com.google.gwt.core.client.GWT; |
58 |
import com.google.gwt.dom.client.Style.Cursor; |
|
59 |
import com.google.gwt.event.dom.client.ClickEvent; |
|
60 |
import com.google.gwt.event.dom.client.ClickHandler; |
|
53 |
import com.google.gwt.event.dom.client.ContextMenuEvent; |
|
54 |
import com.google.gwt.event.dom.client.ContextMenuHandler; |
|
61 | 55 |
import com.google.gwt.i18n.client.DateTimeFormat; |
62 |
import com.google.gwt.resources.client.ClientBundle; |
|
63 | 56 |
import com.google.gwt.resources.client.ImageResource; |
64 | 57 |
import com.google.gwt.safehtml.client.SafeHtmlTemplates; |
65 | 58 |
import com.google.gwt.safehtml.shared.SafeHtml; |
66 | 59 |
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; |
67 | 60 |
import com.google.gwt.user.cellview.client.CellTable; |
61 |
import com.google.gwt.user.cellview.client.Column; |
|
68 | 62 |
import com.google.gwt.user.client.Event; |
69 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
|
70 |
import com.google.gwt.user.client.ui.Button; |
|
71 | 63 |
import com.google.gwt.user.client.ui.Composite; |
72 |
import com.google.gwt.user.client.ui.HorizontalPanel; |
|
73 | 64 |
import com.google.gwt.user.client.ui.VerticalPanel; |
74 | 65 |
import com.google.gwt.view.client.ListDataProvider; |
75 | 66 |
import com.google.gwt.view.client.MultiSelectionModel; |
76 | 67 |
import com.google.gwt.view.client.ProvidesKey; |
77 |
import com.google.gwt.view.client.SelectionChangeEvent; |
|
78 |
import com.google.gwt.view.client.SelectionChangeEvent.Handler; |
|
79 | 68 |
|
80 | 69 |
/** |
81 | 70 |
* A composite that displays the list of files in a particular folder. |
... | ... | |
91 | 80 |
} |
92 | 81 |
|
93 | 82 |
interface TableResources extends CellTable.Resources { |
94 |
@Source({CellTable.Style.DEFAULT_CSS, "GssCellTable.css"}) |
|
83 |
@Override |
|
84 |
@Source({CellTable.Style.DEFAULT_CSS, "GssCellTable.css"}) |
|
95 | 85 |
TableStyle cellTableStyle(); |
96 | 86 |
} |
97 | 87 |
|
... | ... | |
114 | 104 |
public SafeHtml spanWithIdAndClass(String id, String cssClass, String content); |
115 | 105 |
} |
116 | 106 |
|
117 |
private final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
|
|
107 |
protected final DateTimeFormat formatter = DateTimeFormat.getFormat("d/M/yyyy h:mm a");
|
|
118 | 108 |
|
119 | 109 |
/** |
120 | 110 |
* Specifies that the images available for this composite will be the ones |
121 | 111 |
* available in FileContextMenu. |
122 | 112 |
*/ |
123 |
public interface Images extends ClientBundle,FileContextMenu.Images, FolderTreeView.Images {
|
|
113 |
public interface Images extends FolderTreeView.Images { |
|
124 | 114 |
|
125 | 115 |
@Source("gr/grnet/pithos/resources/blank.gif") |
126 | 116 |
ImageResource blank(); |
... | ... | |
214 | 204 |
/** |
215 | 205 |
* The widget's image bundle. |
216 | 206 |
*/ |
217 |
private final Images images;
|
|
207 |
protected final Images images;
|
|
218 | 208 |
|
219 |
private CellTable<File> celltable;
|
|
209 |
protected CellTable<File> celltable;
|
|
220 | 210 |
|
221 | 211 |
private final MultiSelectionModel<File> selectionModel; |
222 | 212 |
|
223 |
private final List<SortableHeader> allHeaders = new ArrayList<SortableHeader>();
|
|
213 |
protected final List<SortableHeader> allHeaders = new ArrayList<SortableHeader>();
|
|
224 | 214 |
|
225 | 215 |
SortableHeader nameHeader; |
226 | 216 |
|
227 | 217 |
FolderTreeView treeView; |
228 | 218 |
|
229 |
private Pithos app;
|
|
219 |
protected Pithos app;
|
|
230 | 220 |
|
231 | 221 |
/** |
232 | 222 |
* Construct the file list widget. This entails setting up the widget |
... | ... | |
391 | 381 |
/** |
392 | 382 |
* Update the display of the file list. |
393 | 383 |
*/ |
394 |
void update(boolean sort) { |
|
384 |
void update(@SuppressWarnings("unused") boolean sort) {
|
|
395 | 385 |
showCellTable(); |
396 | 386 |
} |
397 | 387 |
|
... | ... | |
401 | 391 |
* @param file |
402 | 392 |
* @return the icon |
403 | 393 |
*/ |
404 |
private ImageResource getFileIcon(File file) {
|
|
394 |
protected ImageResource getFileIcon(File file) {
|
|
405 | 395 |
String mimetype = file.getContentType(); |
406 | 396 |
boolean shared = file.isShared(); |
407 | 397 |
if (mimetype == null) |
... | ... | |
495 | 485 |
} |
496 | 486 |
} |
497 | 487 |
|
498 |
private void sortFiles(final String sortingProperty, final boolean sortingType){
|
|
488 |
protected void sortFiles(final String sortingProperty, final boolean sortingType){
|
|
499 | 489 |
Collections.sort(files, new Comparator<File>() { |
500 | 490 |
|
501 | 491 |
@Override |
502 | 492 |
public int compare(File arg0, File arg1) { |
503 |
AbstractImagePrototype descPrototype = AbstractImagePrototype.create(images.desc()); |
|
504 |
AbstractImagePrototype ascPrototype = AbstractImagePrototype.create(images.asc()); |
|
505 | 493 |
if (sortingType){ |
506 | 494 |
if (sortingProperty.equals("version")) { |
507 | 495 |
return arg0.getVersion() - arg1.getVersion(); |
... | ... | |
556 | 544 |
this.header=header; |
557 | 545 |
} |
558 | 546 |
@Override |
559 |
public void update(String value) { |
|
547 |
public void update(@SuppressWarnings("unused") String value) {
|
|
560 | 548 |
header.setSorted(true); |
561 | 549 |
header.toggleReverseSort(); |
562 | 550 |
|
Also available in: Unified diff