Ready to release #861

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@119993 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-10-23 11:46:09 +00:00
parent a16ed5daf4
commit 2adc4d5bcd
4 changed files with 30 additions and 31 deletions

View File

@ -2,11 +2,9 @@ package org.gcube.portlet.user.my_vres.client;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import org.gcube.portlet.user.my_vres.client.widgets.ClickableVRE;
import org.gcube.portlet.user.my_vres.shared.VO;
import org.gcube.portlet.user.my_vres.shared.VRE;
import com.google.gwt.core.client.GWT;
@ -16,6 +14,7 @@ import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
/**
*
@ -30,7 +29,7 @@ public class VresPanel extends Composite {
private final MyVREsServiceAsync myVREsService = GWT.create(MyVREsService.class);
private FlowPanel flowPanel;
private VerticalPanel mainPanel = new VerticalPanel();
private HorizontalPanel changeViewPanel = new HorizontalPanel();
private SimplePanel catPanel = new SimplePanel();
private HorizontalPanel imagesPanel = new HorizontalPanel();
private LinkedHashMap<String, ArrayList<VRE>> cachedVREs = null;
@ -45,10 +44,7 @@ public class VresPanel extends Composite {
this.flowPanel = new FlowPanel();
flowPanel.setWidth("100%");
flowPanel.setStyleName("flowPanel");
changeViewPanel.setWidth("95%");
changeViewPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
changeViewPanel.add(imagesPanel);
catPanel.setWidth("95%");
loadVREs();
initWidget(mainPanel);
}
@ -74,27 +70,27 @@ public class VresPanel extends Composite {
}
private void showIconView() {
mainPanel.clear();
flowPanel.clear();
mainPanel.add(changeViewPanel);
mainPanel.add(flowPanel);
ArrayList<VRE> sortedVREs = new ArrayList<VRE>();
mainPanel.clear();
for (String cat : cachedVREs.keySet()) {
for (VRE vre: cachedVREs.get(cat)) {
sortedVREs.add(vre);
hasVres = true;
if (! cachedVREs.get(cat).isEmpty()) {
SimplePanel catPanel = new SimplePanel();
catPanel.setStyleName("category-panel");
HTML categ = new HTML(cat);
categ.setStyleName("category-name");
catPanel.add(categ);
mainPanel.add(catPanel);
FlowPanel flowPanel = new FlowPanel();
flowPanel.setWidth("100%");
flowPanel.setStyleName("flowPanel");
for (VRE vre: cachedVREs.get(cat)) {
ClickableVRE vreButton = new ClickableVRE(vre, myVREsService);
flowPanel.add(vreButton);
}
mainPanel.add(flowPanel);
}
}
for (VRE vre : sortedVREs) {
ClickableVRE vreButton = new ClickableVRE(vre, myVREsService);
flowPanel.add(vreButton);
}
if (!hasVres) {
if (cachedVREs.isEmpty()) {
mainPanel.add(new NoVresPanel());
imagesPanel.clear();
}

View File

@ -50,14 +50,9 @@ public class ClickableVRE extends HTML {
addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showLoading();
Location.assign(vre.getFriendlyURL());
}
});
}
public void showLoading() {
String html = "<table width=\"100%\" height=\"120px\"><tr height=\"120px\"><td align=\"center\"><img src=\"" + img.getUrl() + "\"></td></tr></table>";
setHTML(html);
}
}

View File

@ -260,6 +260,9 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
toAdd.add(cool_EM_VRE);
toAdd.add(cool_EM_VRE2);
toAdd.add(cool_EM_VRE3);
toAdd.add(cool_EM_VRE);
toAdd.add(cool_EM_VRE2);
toAdd.add(cool_EM_VRE3);
VRE demo = new VRE();

View File

@ -47,10 +47,15 @@ a.vrelink:hover {
padding: 5px;
}
.switcher {
.category-panel {
width: 95%;
}
.category-name {
margin-top: 8px;
color: #999;
font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;
font-size: 8px;
font-size: 10px;
font-variant:small-caps;
font-weight: bold;
}