#1244 VREs sorted in alphabetical Order, VRE Name too long cut also List View

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/my-vres@68882 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-02-06 11:13:52 +00:00
parent 4c25776deb
commit a95c40d3f4
2 changed files with 25 additions and 13 deletions

View File

@ -61,7 +61,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);
@ -79,7 +79,7 @@ public class VresPanel extends Composite {
showIconView();
}
});
setLastStateUsingCookie();
}
@ -103,10 +103,11 @@ public class VresPanel extends Composite {
mainPanel.add(changeViewPanel);
HTML voTitle = new HTML(VO);
voTitle.setStyleName("listPanel-title");
BulletList voList = new BulletList();
voList.setStyleName("list");
boolean showVOs = false;
for (VO vo: cachedVOs) {
if (! vo.isRoot() && vo.getUserBelonging() == UserBelonging.BELONGING) {
voList.add(addVo(vo));
@ -119,16 +120,25 @@ public class VresPanel extends Composite {
}
HTML vreTitle = new HTML(VRE);
vreTitle.setStyleName("listPanel-title");
BulletList vreList = new BulletList();
vreList.setStyleName("list");
boolean showVREs = false;
ArrayList<VRE> sortedVREs = new ArrayList<VRE>();
for (VO vo: cachedVOs) {
for (VRE vre : vo.getVres()) {
vreList.add(addVRE(vre));
showVREs = true;
sortedVREs.add(vre);
hasVres = true;
}
}
Collections.sort(sortedVREs);
for (VRE vre : sortedVREs) {
vreList.add(addVRE(vre));
showVREs = true;
}
if (showVREs) {
mainPanel.add(vreTitle);
mainPanel.add(vreList);
@ -143,7 +153,7 @@ public class VresPanel extends Composite {
flowPanel.clear();
mainPanel.add(changeViewPanel);
mainPanel.add(flowPanel);
ArrayList<VRE> sortedVREs = new ArrayList<VRE>();
for (VO vo: cachedVOs) {
for (VRE vre : vo.getVres()) {
@ -152,12 +162,12 @@ public class VresPanel extends Composite {
}
}
Collections.sort(sortedVREs);
for (VRE vre : sortedVREs) {
ClickableVRE vreButton = new ClickableVRE(vre, myVREsService);
flowPanel.add(vreButton);
}
if (!hasVres) {
mainPanel.add(new NoVresPanel());
imagesPanel.clear();
@ -209,7 +219,7 @@ public class VresPanel extends Composite {
});
return li;
}
private void showLoading(final ListItem li) {
li.setText("Loading .");
@ -224,14 +234,14 @@ public class VresPanel extends Composite {
};
t.schedule(250);
}
private void setSwitcherText() {
if (isIconView)
switcher.setHTML("SHOW LIST");
else
switcher.setHTML("SHOW TILES");
}
/**
*

View File

@ -290,7 +290,7 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
emVO.setDescription("EM and AEM Virtual Organisation The FARM Virtual Organisation is the dynamic group of individuals and/or institutions defined around a set of sharing rules in which resource providers and consumers specify clearly and carefully just what is shared, who is allowed to share, and the conditions under which sharing occurs to serve the needs of the Fisheries and Aquaculture Resources Management.");
emVO.setImageURL("http://portal.d4science.research-infrastructures.eu/vologin/html/RedGrid.jpg");
emVO.setUserBelonging(UserBelonging.NOT_BELONGING);
emVO.setUserBelonging(UserBelonging.BELONGING);
//
//
VRE cool_EM_VRE = new VRE();
@ -343,6 +343,8 @@ public class MyVREsServiceImpl extends RemoteServiceServlet implements MyVREsSer
emVO.addVRE(cool_EM_VRE3);
emVO.addVRE(demo);
emVO.addVRE(vreGCM);
emVO.setUserBelonging(UserBelonging.BELONGING);
ArrayList<VO> toReturn = new ArrayList<VO>();
toReturn.add(rootVO);