X-Git-Url: https://code.grnet.gr/git/pithos/blobdiff_plain/16baf609bb746ccbc6cd8da7213ee74cf474f2a9..ff8eb545cfab6483d485c8fc4c5b652bfe16bbdb:/src/gr/ebs/gss/client/VersionsList.java
diff --git a/src/gr/ebs/gss/client/VersionsList.java b/src/gr/ebs/gss/client/VersionsList.java
index 6eeadad..6f23f1e 100644
--- a/src/gr/ebs/gss/client/VersionsList.java
+++ b/src/gr/ebs/gss/client/VersionsList.java
@@ -31,17 +31,18 @@ import java.util.Date;
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.user.client.DeferredCommand;
import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
/**
* @author kman
@@ -91,7 +92,7 @@ public class VersionsList extends Composite {
permTable.getFlexCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);
permTable.getFlexCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_CENTER);
permPanel.add(permTable);
- permPanel.addStyleName("gwt-TabPanelBottom");
+ permPanel.addStyleName("gss-TabPanelBottom");
permTable.addStyleName("gss-permList");
initWidget(permPanel);
updateTable();
@@ -104,10 +105,10 @@ public class VersionsList extends Composite {
toRemove = null;
}
for (final FileResource dto : versions) {
- HTML restoreVersion = new HTML(""+images.restore().getHTML()+"Restore this Version
");
- restoreVersion.addClickListener( new ClickListener() {
-
- public void onClick(Widget sender) {
+ HTML restoreVersion = new HTML(""+AbstractImagePrototype.create(images.restore()).getHTML()+"Restore this Version
");
+ restoreVersion.addClickHandler( new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
restoreVersion(dto);
}
});
@@ -116,20 +117,18 @@ public class VersionsList extends Composite {
permTable.setHTML(i, 1, "" + formatDate(dto.getCreationDate()) + "");
permTable.setHTML(i, 2, "" + formatDate(dto.getModificationDate()) + "");
permTable.setHTML(i, 3, "" + dto.getFileSizeAsString() + "");
- HTML downloadHtml = new HTML(""+images.download().getHTML()+"View this Version
");
- downloadHtml.addClickListener(new ClickListener(){
-
- public void onClick(Widget arg0) {
+ HTML downloadHtml = new HTML(""+AbstractImagePrototype.create(images.download()).getHTML()+"View this Version
");
+ downloadHtml.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
GSS app = GSS.get();
String dateString = RestCommand.getDate();
String resource = dto.getUri().substring(app.getApiPath().length()-1, dto.getUri().length());
String sig = app.getCurrentUserResource().getUsername()+" "+RestCommand.calculateSig("GET", dateString, resource, RestCommand.base64decode(app.getToken()));
String fileUrl = dto.getUri() + "&Authorization=" + URL.encodeComponent(sig) + "&Date="+URL.encodeComponent(dateString);
Window.open(fileUrl, "_BLANK", "");
-
}
});
- GWT.log("images:"+images.download().getHTML(), null);
permTable.setWidget(i, 4, downloadHtml);
permTable.setWidget(i, 5, restoreVersion);
permTable.getFlexCellFormatter().setStyleName(i, 0, "props-labels");