|
|
|
@ -9,6 +9,7 @@ import org.gcube.portlet.user.my_vres.shared.VRE;
|
|
|
|
|
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
|
import com.google.gwt.safehtml.shared.SafeHtml;
|
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
|
import com.google.gwt.user.client.ui.FlowPanel;
|
|
|
|
@ -25,6 +26,7 @@ import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
|
|
*/
|
|
|
|
|
public class VresPanel extends Composite {
|
|
|
|
|
public static final String loading = GWT.getModuleBaseURL() + "../images/loading.gif";
|
|
|
|
|
private static final String ADD_OTHER = "Add More";
|
|
|
|
|
private final MyVREsServiceAsync myVREsService = GWT.create(MyVREsService.class);
|
|
|
|
|
private FlowPanel flowPanel;
|
|
|
|
|
private VerticalPanel mainPanel = new VerticalPanel();
|
|
|
|
@ -87,6 +89,7 @@ public class VresPanel extends Composite {
|
|
|
|
|
ClickableVRE vreButton = new ClickableVRE(vre, myVREsService);
|
|
|
|
|
flowPanel.add(vreButton);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mainPanel.add(flowPanel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -94,9 +97,29 @@ public class VresPanel extends Composite {
|
|
|
|
|
if (! hasAtLeastOneVRE(cachedVREs)) {
|
|
|
|
|
mainPanel.add(new NoVresPanel());
|
|
|
|
|
imagesPanel.clear();
|
|
|
|
|
} else {
|
|
|
|
|
addMoreVREsButton();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void addMoreVREsButton() {
|
|
|
|
|
SimplePanel catPanel = new SimplePanel();
|
|
|
|
|
catPanel.setStyleName("category-panel");
|
|
|
|
|
HTML categ = new HTML(ADD_OTHER);
|
|
|
|
|
categ.setStyleName("category-name");
|
|
|
|
|
catPanel.add(categ);
|
|
|
|
|
|
|
|
|
|
mainPanel.add(catPanel);
|
|
|
|
|
FlowPanel flowPanel = new FlowPanel();
|
|
|
|
|
flowPanel.setWidth("100%");
|
|
|
|
|
flowPanel.setStyleName("flowPanel");
|
|
|
|
|
|
|
|
|
|
ClickableVRE vreButton = new ClickableVRE(myVREsService);
|
|
|
|
|
flowPanel.add(vreButton);
|
|
|
|
|
|
|
|
|
|
mainPanel.add(flowPanel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean hasAtLeastOneVRE(LinkedHashMap<String, ArrayList<VRE>> cachedVREs) {
|
|
|
|
|
for (String cat : cachedVREs.keySet())
|
|
|
|
|