From 84ec439a3c037018946e060647c40cb3f7747ffc Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 30 Jan 2015 11:12:07 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@111555 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/TabularResourceProperties.java | 114 +++++------------- 1 file changed, 31 insertions(+), 83 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java index a94c4a1..e1a50f6 100644 --- a/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java @@ -2,7 +2,6 @@ package org.gcube.portlets.user.td.informationwidget.client; import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; import java.util.List; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; @@ -17,8 +16,6 @@ import org.gcube.portlets.user.td.informationwidget.client.custom.IconButton; import org.gcube.portlets.user.td.informationwidget.client.licence.LicenceDataPropertiesCombo; import org.gcube.portlets.user.td.informationwidget.client.resources.ResourceBundle; import org.gcube.portlets.user.td.informationwidget.client.util.UtilsGXT3; -import org.gcube.portlets.user.td.metadatawidget.client.TRMetadataAccordionPanel; -import org.gcube.portlets.user.td.metadatawidget.client.TableMetadataAccordionPanel; import org.gcube.portlets.user.td.widgetcommonevent.client.event.DataViewRequestEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; @@ -44,9 +41,6 @@ import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction; import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode; import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.data.shared.ListStore; -import com.sencha.gxt.data.shared.loader.ListLoadConfig; -import com.sencha.gxt.data.shared.loader.ListLoadResult; -import com.sencha.gxt.data.shared.loader.ListLoader; import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; @@ -71,51 +65,40 @@ import com.sencha.gxt.widget.core.client.form.TextField; public class TabularResourceProperties extends FramedPanel { private static final String DESCRIPTION_FIELD_HEIGHT = "70px"; - // private static final String LISTVIEWWIDTH="250px"; private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd"); - protected String headingTitle; - protected HashMap tabularResourcePropertiesMap; - //protected VerticalLayoutContainer vl; - protected EventBus eventBus; - protected TRId trId; + private EventBus eventBus; + private TRId trId; - //protected FieldSet trFieldSet; - //protected FieldSet tableFieldSet; - - protected TabResource tabResource; - protected TextField nameField; - protected TextArea descriptionField; - protected TextField agencyField; - protected TextField dateField; - protected TextArea rightField; - protected DateField validFromField; - protected DateField validUntilToField; - protected TextField ownerField; - protected CheckBox validField; - protected CheckBox finalizedField; - - protected ListLoader> loader; - protected ComboBox comboLicences; - protected ListStore storeCombo; - - protected TextField typeField; - protected TextField tableTypeNameField; - - protected IconButton btnShare; - protected FieldLabel shareLabel; - - protected TRMetadataAccordionPanel trMetadataPanel; - protected VerticalLayoutContainer layoutTabularResource; - - protected TextField tableTypeDefField; - protected TableMetadataAccordionPanel tableMetadataPanel; - protected VerticalLayoutContainer layoutTable; - protected TextButton saveButton; - protected TextButton validationsButton; - protected TextButton resourcesButton; - protected ArrayList licencesList; + private TabResource tabResource; + private TextField nameField; + private TextArea descriptionField; + private TextField agencyField; + private TextField dateField; + private TextArea rightField; + private DateField validFromField; + private DateField validUntilToField; + private TextField ownerField; + private CheckBox validField; + private CheckBox finalizedField; + + private ComboBox comboLicences; + private ListStore storeCombo; + + private TextField typeField; + private TextField tableTypeNameField; + + private IconButton btnShare; + private FieldLabel shareLabel; + + private VerticalLayoutContainer layoutTabularResource; + + private TextButton saveButton; + private TextButton validationsButton; + private TextButton resourcesButton; + + private ArrayList licencesList; public TabularResourceProperties(String name, EventBus eventBus) { super(); @@ -128,29 +111,17 @@ public class TabularResourceProperties extends FramedPanel { } public void addTabularResource() { - //vl = new VerticalLayoutContainer(); - //vl.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1 - //vl.setAdjustForScroll(true); - - //trFieldSet = new FieldSet(); - //trFieldSet.setHeadingText("Tabular Resource"); - //trFieldSet.setCollapsible(true); - //trFieldSet.setResize(true); - layoutTabularResource = new VerticalLayoutContainer(); layoutTabularResource.setScrollMode(ScrollMode.AUTOY); layoutTabularResource.setAdjustForScroll(true); - //trFieldSet.add(layoutTabularResource); - + nameField = new TextField(); - // nameField.setReadOnly(true); nameField.setValue(""); layoutTabularResource.add(new FieldLabel(nameField, "Name"), new VerticalLayoutData(1, -1)); descriptionField = new TextArea(); descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT); - // descriptionField.setReadOnly(true); descriptionField.setValue(""); layoutTabularResource.add(new FieldLabel(descriptionField, "Description"), new VerticalLayoutData(1, -1)); @@ -163,7 +134,6 @@ public class TabularResourceProperties extends FramedPanel { agencyField = new TextField(); - // agencyField.setReadOnly(true); agencyField.setValue(""); layoutTabularResource.add(new FieldLabel(agencyField, "Agency"), new VerticalLayoutData(1, -1)); @@ -181,7 +151,6 @@ public class TabularResourceProperties extends FramedPanel { new VerticalLayoutData(1, -1)); rightField = new TextArea(); - // rightField.setReadOnly(true); rightField.setValue(""); layoutTabularResource.add(new FieldLabel(rightField, "Rights"), new VerticalLayoutData(1, -1)); @@ -194,7 +163,6 @@ public class TabularResourceProperties extends FramedPanel { layoutTabularResource.add(new FieldLabel(validUntilToField, "Valid Until To"), new VerticalLayoutData(1, -1)); - // // // Combo Licences LicenceDataPropertiesCombo propsLicenceData = GWT .create(LicenceDataPropertiesCombo.class); @@ -210,7 +178,6 @@ public class TabularResourceProperties extends FramedPanel { Log.trace("Combo Licence created"); - // / layoutTabularResource.add(new FieldLabel(comboLicences, "Licence"), new VerticalLayoutData(1, -1)); // / @@ -242,7 +209,6 @@ public class TabularResourceProperties extends FramedPanel { new VerticalLayoutData(1, -1)); finalizedField = new CheckBox(); - // finalizedField.setBoxLabel(""); finalizedField.setValue(false); finalizedField.addValueChangeHandler(new ValueChangeHandler() { @@ -314,8 +280,6 @@ public class TabularResourceProperties extends FramedPanel { - //vl.add(trFieldSet, new VerticalLayoutData(1, -1, - // new Margins(0))); add(layoutTabularResource); } @@ -490,17 +454,6 @@ public class TabularResourceProperties extends FramedPanel { protected void updateTable(TableData tableData) { trId = tableData.getTrId(); - /* - * tableTypeNameField.setValue(tableData.getTypeName()); if - * (tableMetadataPanel != null) { tableFieldSet.remove(layoutTable); - * layoutTable.remove(tableMetadataPanel); } - * - * - * tableMetadataPanel = new TableMetadataAccordionPanel( - * "TableInformation", trId, eventBus); - * layoutTable.add(tableMetadataPanel, new VerticalLayoutData(-1, -1)); - * tableFieldSet.add(layoutTable); - */ forceLayout(); } @@ -512,7 +465,6 @@ public class TabularResourceProperties extends FramedPanel { Log.info("Retrived TR: " + result.getTrId()); updateTabularResource(result); getLastTable(tabResource.getTrId()); - //getShareInformation(result.getTrId()); } public void onFailure(Throwable caught) { @@ -527,9 +479,6 @@ public class TabularResourceProperties extends FramedPanel { } else { Log.error("Error retrienving properties: " + caught.getLocalizedMessage()); - /*UtilsGXT3.alert("Error", - "Error retrienving properties: " - + caught.getLocalizedMessage());*/ } } @@ -577,7 +526,6 @@ public class TabularResourceProperties extends FramedPanel { new AsyncCallback() { public void onSuccess(TableData result) { - //Log.debug("Retrieved LastTable:" + result); updateTable(result); }