From 800a2417b4cf58f3e178a9eaad411f2119de8343 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Thu, 23 Mar 2017 18:36:31 +0000 Subject: [PATCH] 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 --- .../client/CKanMetadataPublisher.java | 42 +++++++++++++++++++ .../TwinColumnSelection/ResourceCellLeft.java | 2 +- .../ResourceCellRight.java | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/CKanMetadataPublisher.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/CKanMetadataPublisher.java index 56d4e5e..cc142f1 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/CKanMetadataPublisher.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/CKanMetadataPublisher.java @@ -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 children = new ArrayList(); + + // 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(); + + } } diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java index 89bea27..1a9c681 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellLeft.java @@ -32,7 +32,7 @@ public class ResourceCellLeft extends AbstractCell{ folder.setHeight("15px"); String whichTip = value.isFolder() ? tipFolder : tipFile; - sb.appendHtmlConstant("
"); + sb.appendHtmlConstant("
"); sb.appendHtmlConstant(""); sb.appendHtmlConstant(value.isFolder() ? folder.toString() : file.toString()); sb.appendHtmlConstant(""); diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellRight.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellRight.java index 67320a3..e41a8ff 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellRight.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/TwinColumnSelection/ResourceCellRight.java @@ -37,7 +37,7 @@ public class ResourceCellRight extends AbstractCell{ file.setWidth("15px"); file.setHeight("15px"); - sb.appendHtmlConstant("
"); + sb.appendHtmlConstant("
"); sb.appendHtmlConstant(""); sb.appendHtmlConstant(file.toString()); sb.appendHtmlConstant("");