2016-11-07 18:47:06 +01:00
|
|
|
package org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.TwinColumnSelection;
|
|
|
|
|
2016-11-09 19:13:39 +01:00
|
|
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
|
|
|
|
|
|
|
import com.github.gwtbootstrap.client.ui.Icon;
|
|
|
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
2016-11-07 18:47:06 +01:00
|
|
|
import com.google.gwt.cell.client.AbstractCell;
|
|
|
|
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cell that renders right side panel objects
|
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
|
|
|
public class ResourceCellRight extends AbstractCell<ResourceElementBean>{
|
|
|
|
|
2016-11-09 19:13:39 +01:00
|
|
|
private static final String HTML_FILE = new Icon(IconType.FILE_ALT).toString();
|
|
|
|
|
2016-11-07 18:47:06 +01:00
|
|
|
@Override
|
|
|
|
public void render(com.google.gwt.cell.client.Cell.Context context,
|
|
|
|
ResourceElementBean value, SafeHtmlBuilder sb) {
|
|
|
|
|
2016-11-09 19:13:39 +01:00
|
|
|
if (value == null || !value.isToBeAdded() || value.isFolder()) {
|
2016-11-07 18:47:06 +01:00
|
|
|
return;
|
|
|
|
}
|
2016-11-09 19:13:39 +01:00
|
|
|
|
|
|
|
sb.appendHtmlConstant("<div style='width:100%; padding:2px'>");
|
|
|
|
sb.appendHtmlConstant(HTML_FILE);
|
|
|
|
sb.appendHtmlConstant("<span style='margin-left:5px'>");
|
2016-11-07 18:47:06 +01:00
|
|
|
sb.appendHtmlConstant("<b>");
|
2016-11-09 19:13:39 +01:00
|
|
|
sb.appendEscaped(value.getFullPath());
|
2016-11-07 18:47:06 +01:00
|
|
|
sb.appendHtmlConstant("</b>");
|
2016-11-09 19:13:39 +01:00
|
|
|
sb.appendHtmlConstant("</span>");
|
|
|
|
sb.appendHtmlConstant("</div>");
|
2016-11-07 18:47:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|