Added Upldoad Image View
parent
a72d7de599
commit
c5c6823587
@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francesco-mangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT
|
||||
lastWarOutDir=/home/francesco/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
@ -0,0 +1,13 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.resources;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
|
||||
public interface Images extends ClientBundle {
|
||||
|
||||
public static final Images ICONS = GWT.create(Images.class);
|
||||
|
||||
@Source("loading.gif")
|
||||
ImageResource loading();
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,54 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui.images;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Heading;
|
||||
import com.github.gwtbootstrap.client.ui.Image;
|
||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class ImageView extends Composite {
|
||||
|
||||
private static ImageViewUiBinder uiBinder = GWT.create(ImageViewUiBinder.class);
|
||||
|
||||
interface ImageViewUiBinder extends UiBinder<Widget, ImageView> {
|
||||
}
|
||||
|
||||
public ImageView() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
@UiField
|
||||
Image imageURL;
|
||||
|
||||
@UiField
|
||||
Heading heading;
|
||||
|
||||
@UiField
|
||||
Paragraph paragraph1;
|
||||
|
||||
|
||||
public ImageView(UploadedImageDV imageDV) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
imageDV.getDidascalia();
|
||||
heading.setText(imageDV.getTitolo());
|
||||
paragraph1.setText(imageDV.getDidascalia());
|
||||
|
||||
if(imageDV.getListWsContent()!=null && imageDV.getListWsContent().size()>0) {
|
||||
WorkspaceContentDV latest = imageDV.getListWsContent().get(imageDV.getListWsContent().size()-1);
|
||||
imageURL.setUrl(latest.getLink());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.max-width-300 {
|
||||
max-width: 300px;
|
||||
}
|
||||
</ui:style>
|
||||
<b:Thumbnail size="4">
|
||||
<b:Image ui:field="imageURL"
|
||||
addStyleNames="{style.max-width-300}" />
|
||||
<b:Caption>
|
||||
<b:Heading size="4" ui:field="heading"></b:Heading>
|
||||
<b:Paragraph ui:field="paragraph1">
|
||||
</b:Paragraph>
|
||||
<b:Paragraph ui:field="paragraph2">
|
||||
<b:Button ui:field="expandImage">Expand</b:Button>
|
||||
</b:Paragraph>
|
||||
</b:Caption>
|
||||
</b:Thumbnail>
|
||||
</ui:UiBinder>
|
@ -0,0 +1,61 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.util;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.Images;
|
||||
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
|
||||
/**
|
||||
* The Class LoaderIcon.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 19, 2015
|
||||
*/
|
||||
public class LoaderIcon extends HorizontalPanel{
|
||||
|
||||
|
||||
private Image imgLoading = new Image(Images.ICONS.loading());
|
||||
private HTML txtLoading = new HTML("");
|
||||
|
||||
/**
|
||||
* Instantiates a new loader icon.
|
||||
*
|
||||
* @param txtHTML the txt html
|
||||
*/
|
||||
public LoaderIcon(String txtHTML) {
|
||||
this();
|
||||
setText(txtHTML);
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new loader icon.
|
||||
*/
|
||||
public LoaderIcon() {
|
||||
setStyleName("marginTop20");
|
||||
add(imgLoading);
|
||||
add(txtLoading);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text.
|
||||
*
|
||||
* @param txtHTML the new text
|
||||
*/
|
||||
public void setText(String txtHTML){
|
||||
txtLoading.setHTML("<span style=\"margin-left:5px; vertical-align:middle;\">"+txtHTML+"</span>");
|
||||
}
|
||||
|
||||
/**
|
||||
* Show.
|
||||
*
|
||||
* @param bool the bool
|
||||
*/
|
||||
public void show(boolean bool){
|
||||
this.setVisible(bool);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.shared.products.content;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
/**
|
||||
* The Class WorkspaceContentDV.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
||||
*
|
||||
* Nov 5, 2020
|
||||
*/
|
||||
public class WorkspaceContentDV implements IsSerializable, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3919923007831416696L;
|
||||
|
||||
/** The mimetype. */
|
||||
private String mimetype;
|
||||
|
||||
/** The storage ID. */
|
||||
private String storageID;
|
||||
|
||||
/** The link. */
|
||||
private String link;
|
||||
|
||||
private Long id;
|
||||
|
||||
public WorkspaceContentDV() {
|
||||
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMimetype() {
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public void setMimetype(String mimetype) {
|
||||
this.mimetype = mimetype;
|
||||
}
|
||||
|
||||
public String getStorageID() {
|
||||
return storageID;
|
||||
}
|
||||
|
||||
public void setStorageID(String storageID) {
|
||||
this.storageID = storageID;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("WorkspaceContentDV [mimetype=");
|
||||
builder.append(mimetype);
|
||||
builder.append(", storageID=");
|
||||
builder.append(storageID);
|
||||
builder.append(", link=");
|
||||
builder.append(link);
|
||||
builder.append(", id=");
|
||||
builder.append(id);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue