package org.gcube.portlets.user.workspace.client.view.toolbars; import com.extjs.gxt.ui.client.widget.HorizontalPanel; import com.extjs.gxt.ui.client.widget.LayoutContainer; import com.google.gwt.user.client.ui.AbstractImagePrototype; import com.google.gwt.user.client.ui.HTML; /** * * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * @Feb 17, 2014 * */ public class ACLDivInfo extends LayoutContainer { private HorizontalPanel hpPanel = new HorizontalPanel(); private HTML text = new HTML(); public ACLDivInfo(String caption, AbstractImagePrototype img) { super(); super.setWidth(80); setId("ACLDivInfo"); text.setPixelSize(50, 26); hpPanel.setWidth("100%"); updateInfo(caption,img); hpPanel.add(text); add(hpPanel); } public void updateInfo(String caption, AbstractImagePrototype img){ String html = "
"; if(img!=null) html+=addImage(img); if(caption!=null) html+=addCaption(caption); html+="
"; text.setHTML(html); hpPanel.layout(); this.layout(); } private String addImage(AbstractImagePrototype img){ return "" + img.getHTML() + ""; } private String addCaption(String caption){ return ""+ caption+""; } }