fixed twin columns rendering

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@146308 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-03-23 18:36:31 +00:00
parent eaf8dc4ff8
commit 800a2417b4
3 changed files with 44 additions and 2 deletions

View File

@ -5,14 +5,18 @@ import java.util.List;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.MetaDataFieldSkeleton;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.TwinColumnSelection.TwinColumnSelectionMainPanel;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DataType;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.MetadataFieldWrapper;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.Modal;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.SelectElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
@ -40,6 +44,7 @@ public class CKanMetadataPublisher implements EntryPoint {
// testMetadata();
// testSelectionPanel();
// testHideOption();
// startTwinColumn();
}
@SuppressWarnings("unused")
@ -221,4 +226,41 @@ public class CKanMetadataPublisher implements EntryPoint {
RootPanel.get("ckan-metadata-publisher-div").add(new CreateDatasetForm(idFolderWorkspace, eventBus));
}
// test resources
TwinColumnSelectionMainPanel resourcesTwinPanel;
private void startTwinColumn() {
Modal m = new Modal();
m.setTitle("Title ......");
m.setWidth("1200px");
m.getElement().getStyle().setMarginLeft(-30, Unit.PCT);
ResourceElementBean r = new ResourceElementBean();
r.setFolder(true);
r.setName("Root");
r.setParent(null);
List<ResourceElementBean> children = new ArrayList<ResourceElementBean>();
// random strings
for (int i = 0; i < 10; i++) {
ResourceElementBean child = new ResourceElementBean();
child.setFolder(false);
child.setName("BLUE_ECONOMY_WP6_TECHNO_ECONOMIC_ANALYSIS_MODEL.CITE.PPTX" + i);
child.setEditableName("BLUE_ECONOMY_WP6_TECHNO_ECONOMIC_ANALYSIS_MODEL.CITE.PPTX" + i);
child.setParent(r);
child.setFullPath("/" + "BLUE_ECONOMY_WP6_TECHNO_ECONOMIC_ANALYSIS_MODEL.CITE.PPTX" + + i);
children.add(child);
}
r.setChildren(children);
// create random childs
resourcesTwinPanel = new TwinColumnSelectionMainPanel(r);
m.add(resourcesTwinPanel);
m.show();
}
}

View File

@ -32,7 +32,7 @@ public class ResourceCellLeft extends AbstractCell<ResourceElementBean>{
folder.setHeight("15px");
String whichTip = value.isFolder() ? tipFolder : tipFile;
sb.appendHtmlConstant("<div title='" + whichTip + "' style='width:100%; min-height:30px; padding-top:5px;'>");
sb.appendHtmlConstant("<div title='" + value.getName() + "( " + whichTip + " )" + "' style='overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:240px; min-height:30px; padding-top:5px;'>");
sb.appendHtmlConstant("<span style='margin-left:5px;'>");
sb.appendHtmlConstant(value.isFolder() ? folder.toString() : file.toString());
sb.appendHtmlConstant("</span>");

View File

@ -37,7 +37,7 @@ public class ResourceCellRight extends AbstractCell<ResourceElementBean>{
file.setWidth("15px");
file.setHeight("15px");
sb.appendHtmlConstant("<div title='" + tip + "' style='width:100%; min-height:30px; padding-top:5px;'>");
sb.appendHtmlConstant("<div title='" + value.getName() + "( " + tip + " )" + "' style='overflow-x:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:240px; min-height:30px; padding-top:5px;'>");
sb.appendHtmlConstant("<span style='margin-left:5px'>");
sb.appendHtmlConstant(file.toString());
sb.appendHtmlConstant("</span>");