429: Workspace: uploading big files

Task-Url: https://support.d4science.org/issues/429

Updated css
Added new delete
Updated progress bar

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@119679 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-10-13 13:32:01 +00:00
parent a68eb7675f
commit 44b1f04c63
5 changed files with 17 additions and 10 deletions

View File

@ -19,7 +19,7 @@
font: 13px/20px 'Lucida Grande', Tahoma, Verdana, sans-serif;
color: #404040;
margin: 0px auto;
width: 382px;
width: 310px;
}
.bar-container > div {

View File

@ -43,7 +43,7 @@ public interface WorkspaceUploaderIcons extends ClientBundle {
*
* @return the image resource
*/
@Source("cancel.png")
@Source("delete.gif")
ImageResource cancel();
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

View File

@ -111,7 +111,7 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
hpBottom.getElement().getStyle().setMarginTop(10, Unit.PX);
if(uploadType.equals(UPLOAD_TYPE.File)){
HTML msg = new HTML("<p>To select multiple files, press and hold down the Ctrl key, and then click each item </p><p style='margin-top:-2px'> that you want to select</p>");
HTML msg = new HTML("<p>To select multiple files, press and hold down the Ctrl key, and then click each item </p><p style='margin:-3px 0;'> that you want to select</p>");
msg.getElement().getStyle().setFontSize(10, Unit.PX);
hpBottom.add(msg);
}

View File

@ -15,6 +15,7 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
@ -31,6 +32,7 @@ public class UploaderProgressView {
private VerticalPanel vp = new VerticalPanel();
private static final int MAX_CHARS = 50;
private HorizontalPanel hp = new HorizontalPanel();
private HorizontalPanel hpBar = new HorizontalPanel();
private HTML html = new HTML();
private ProgressBar bar = new ProgressBar();
private HandlerManager eventBus;
@ -49,6 +51,7 @@ public class UploaderProgressView {
cancelImg = WorkspaceUploaderResources.getImageCancel();
cancelImg.setTitle("Cancel upload");
cancelImg.addStyleName("cancel-upload");
hpBar.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
String text = "<div><img src='"+WorkspaceUploaderResources.getImageLoading().getUrl()+"'>";
String msg = StringUtil.ellipsize("Uploading "+fileName, MAX_CHARS, 0);
@ -63,7 +66,10 @@ public class UploaderProgressView {
setVisibleBar(false);
vp.add(hp);
vp.add(bar);
hpBar.add(bar);
vp.add(hpBar);
// vp.add(bar);
}
public void setVisibleBar(boolean bool){
@ -86,11 +92,12 @@ public class UploaderProgressView {
html.setHTML(text);
html.setTitle(uploader.getStatusDescription());
bar.update(uploader.getUploadProgress().getLastEvent().getReadPercentage());
// try{
// hpBar.remove(cancelImg);
// }catch (Exception e) {}
try{
hp.remove(cancelImg);
}catch (Exception e) {}
try{
vp.remove(bar);
// hpBar.remove(bar);
hpBar.clear();
}catch (Exception e) {}
break;
case FAILED:
@ -105,7 +112,7 @@ public class UploaderProgressView {
case IN_PROGRESS:
setVisibleBar(true);
// text = "<div><img src='"+WorkspaceUploaderResources.getImageUpload().getUrl()+"'>";
text = "<div>";
text = "<div><img src='"+WorkspaceUploaderResources.getImageLoading().getUrl()+"'>";
String msg = StringUtil.ellipsize(uploader.getFile().getFileName(), MAX_CHARS, 0);
text+="<span style='margin-left:5px; vertical-align: top;'>"+msg+"</span>";
text+="</div>";
@ -115,7 +122,7 @@ public class UploaderProgressView {
if(uploader.getUploadProgress().getLastEvent().getReadPercentage()!=100 && !cancel){
cancel = true;
hp.add(handleCancelUpload(uploader));
hpBar.add(handleCancelUpload(uploader));
}
bar.update(uploader.getUploadProgress().getLastEvent().getReadPercentage());