@ -8,6 +8,7 @@ import org.gcube.portlet.user.my_vres.client.widgets.ClickableVRE;
import org.gcube.portlet.user.my_vres.shared.VRE ;
import com.google.gwt.core.client.GWT ;
import com.google.gwt.core.client.ScriptInjector ;
import com.google.gwt.dom.client.Style.Unit ;
import com.google.gwt.user.client.rpc.AsyncCallback ;
import com.google.gwt.user.client.ui.Composite ;
@ -33,7 +34,7 @@ public class VresPanel extends Composite {
private HorizontalPanel imagesPanel = new HorizontalPanel ( ) ;
private Image loadingImage = new Image ( loading ) ;
private LinkedHashMap < String , ArrayList < VRE > > cachedVREs = null ;
boolean hasVres = false ;
public VresPanel ( GetParameters params ) {
@ -48,10 +49,14 @@ public class VresPanel extends Composite {
catPanel . setWidth ( "95%" ) ;
loadVREs ( params ) ;
initWidget ( mainPanel ) ;
//change the portlet title only if is an authorisation
if ( params ! = null )
ScriptInjector . fromString ( "$wnd.jQuery(\".portlet-title-text\").text('Please select in which of your VREs you approve this application');" ) . inject ( ) ;
}
private void loadVREs ( final GetParameters params ) {
mainPanel . add ( loadingImage ) ;
myVREsService . getUserVREs ( new AsyncCallback < LinkedHashMap < String , ArrayList < VRE > > > ( ) {
@ -92,9 +97,14 @@ public class VresPanel extends Composite {
hasVREs = true ;
ClickableVRE vreButton = new ClickableVRE ( myVREsService , vre , ( i < LOAD_MAX_IMAGE_NO ) , params ) ;
flowPanel . add ( vreButton ) ;
//do not show the add more placeholder VRE is is an authorisation
if ( params ! = null & & vre . getName ( ) . compareTo ( "" ) = = 0 ) {
mainPanel . remove ( catPanel ) ;
flowPanel . remove ( vreButton ) ;
}
i + + ;
}
mainPanel . add ( flowPanel ) ;
}
}
@ -107,9 +117,9 @@ public class VresPanel extends Composite {
}
}