diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/DialogUpload.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/DialogUpload.java index 858f337..7debe48 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/DialogUpload.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/DialogUpload.java @@ -48,13 +48,9 @@ public class DialogUpload extends FormPanel implements HasWorskpaceUploadNotific * Sep 11, 2015 */ private HTML LOADING = new HTML("Upload starting..."); - - protected String parentIdentifier = ""; protected VerticalPanel panel; - private HorizontalPanel hpBottom; // private MonitorPanel monitorPanel; protected String clientUploadKey; - private Anchor anchorMyUploads; /** * Instantiates a new dialog upload stream. @@ -67,7 +63,6 @@ public class DialogUpload extends FormPanel implements HasWorskpaceUploadNotific //setWidth("400px"); fileUpload = new FileUpload(); //fileUpload.getElement().setAttribute("multiple", "multiple"); - this.addStyleName("fileInputUploader"); setAction(ConstantsMPFormBuilder.WORKSPACE_UPLOADER_SERVLET_STREAM__MODIFIED); setEncoding(FormPanel.ENCODING_MULTIPART); setMethod(FormPanel.METHOD_POST); @@ -92,27 +87,7 @@ public class DialogUpload extends FormPanel implements HasWorskpaceUploadNotific hp.getElement().getStyle().setMarginTop(5, Unit.PX); hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); - panel.add(hp); - -// hpBottom = new HorizontalPanel(); -// hpBottom.setWidth("100%"); -//// hpBottom.getElement().getStyle().setMarginTop(5, Unit.PX); -// hpBottom.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); -// -// //if(uploadType.equals(UPLOAD_TYPE.File)){ -//// HTML msg = new HTML("

To select multiple files, press and hold down the Ctrl key, and then

click each item that you want to select

"); -//// msg.getElement().getStyle().setFontSize(10, Unit.PX); -//// hpBottom.add(msg); -// //} -// -// HorizontalPanel hp2 = new HorizontalPanel(); -// hp2.getElement().getStyle().setMarginTop(5, Unit.PX); -//// hp2.getElement().getStyle().setWidth(100, Unit.PCT); -// hp2.addStyleName("align-right-close"); -// -// hpBottom.add(hp2); -// panel.add(hpBottom); } /** diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.java index c53a849..a4ef1f0 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.java @@ -18,7 +18,7 @@ public class FileUpload extends Composite { public FileUpload() { initWidget(uiBinder.createAndBindUi(this)); - fileUploadPanel.add(new DialogUpload()); + fileUploadPanel.add(new MultipleDilaogUpload()); } } diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.ui.xml b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.ui.xml index a684d27..129e405 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.ui.xml +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/FileUpload.ui.xml @@ -1,11 +1,18 @@ + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"> .important { font-weight: bold; } - + + + File: + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/MultipleDilaogUpload.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/MultipleDilaogUpload.java index 38d322a..17eea59 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/MultipleDilaogUpload.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/MultipleDilaogUpload.java @@ -59,7 +59,7 @@ public class MultipleDilaogUpload extends DialogUpload { * @param parentId the parent id * @return the list */ - public void generateFakeUploaders(String filesSelected, String parentId) { + public void generateFakeUploaders(String filesSelected) { if(filesSelected==null || filesSelected.isEmpty()) return; @@ -82,21 +82,13 @@ public class MultipleDilaogUpload extends DialogUpload { fakeItem.setUploadStatus(UPLOAD_STATUS.WAIT); WorkspaceUploadFile fakeFile = new WorkspaceUploadFile(); fakeFile.setFileName(files[i]); - fakeFile.setParentId(parentId); fakeItem.setFile(fakeFile); fakeUploaders.add(fakeItem); } GWT.log("fakeUploaders generated: "+fakeUploaders.toString()); -// return fakeUploaders; } - /* - * (non-Javadoc) - * - * @see org.gcube.portlets.widgets.workspaceuploader.client.uploader. - * DialogUploadStream#addHandlers() - */ @Override protected void addHandlers() { @@ -165,8 +157,7 @@ public class MultipleDilaogUpload extends DialogUpload { @Override public void onChange(ChangeEvent event) { GWT.log("browse return..."); - if (fileUpload.getFilename() == null - || fileUpload.getFilename().isEmpty()) { + if (fileUpload.getFilename() == null || fileUpload.getFilename().isEmpty()) { GWT.log("No file specified "); //MultipleDilaogUpload.this.hide(); return; @@ -182,7 +173,7 @@ public class MultipleDilaogUpload extends DialogUpload { return; // GENERATE NEW UPLOADERS - generateFakeUploaders(filesSelected, parentIdentifier); + generateFakeUploaders(filesSelected); GWT.log(fakeUploaders.toString()); createJsonKeyForFiles(); GWT.log(jsonKeys);