added ACLDivInfo

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@91842 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-02-18 13:42:33 +00:00
parent d9841cda92
commit 6c453b15da
3 changed files with 23 additions and 6 deletions

View File

@ -1068,14 +1068,21 @@ public class AppController implements SubscriberInterface {
if(parent!=null && parent.isDirectory() && parent.isShared())
setACLInfo(parent.getIdentifier());
else
setACLInfo(null);
}
private void setACLInfo(String parentId){
private void setACLInfo(final String parentId){
if(parentId==null){
wsPortlet.getToolBarItemDetails().updateACLInfo(null);
return;
}
GWT.log("Updating ACL info for folder id: "+parentId);
AppControllerExplorer.rpcWorkspaceService.getACLForFolderId(parentId, new AsyncCallback<List<WorkspaceACL>>() {
AppControllerExplorer.rpcWorkspaceService.getUserACLForFolderId(parentId, new AsyncCallback<List<WorkspaceACL>>() {
@Override
public void onFailure(Throwable arg0) {
@ -1085,8 +1092,14 @@ public class AppController implements SubscriberInterface {
@Override
public void onSuccess(List<WorkspaceACL> res) {
if(res!=null && res.size()>0)
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
GWT.log("Validatating correct ACL id: "+parentId +" and "+parent.getIdentifier());
if(parentId.compareTo(parent.getIdentifier())==0){
if(res!=null && res.size()>0)
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
}
}
});
}

View File

@ -20,7 +20,7 @@ public class ACLDivInfo extends LayoutContainer {
public ACLDivInfo(String caption, AbstractImagePrototype img) {
super();
super.setWidth(80);
text.setPixelSize(50, 30);
text.setPixelSize(50, 26);
hpPanel.setWidth("100%");
updateInfo(caption,img);
@ -31,7 +31,7 @@ public class ACLDivInfo extends LayoutContainer {
public void updateInfo(String caption, AbstractImagePrototype img){
String html = "<div style=\"width: 100%; height: 25px; text-align:left;\">";
String html = "<div style=\"width: 100%; height: 24px; text-align:left; padding-top: 2px; opacity: 0.9;\">";
if(img!=null)
html+=addImage(img);

View File

@ -171,6 +171,10 @@ public class GxtBottomToolBarItem extends ToolBar{
public void updateACLInfo(WorkspaceACL acl){
if(acl==null){
aclDivInfo.updateInfo(null, null);
return;
}
AbstractImagePrototype img = GetPermissionIconByACL.getImage(acl);
aclDivInfo.updateInfo(acl.getLabel(), img);
this.layout();