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 8b1a575..b64e2e4 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 @@ -33,6 +33,7 @@ import com.sencha.gxt.widget.core.client.event.HideEvent; import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; +import com.sencha.gxt.widget.core.client.form.CheckBox; import com.sencha.gxt.widget.core.client.form.FieldLabel; import com.sencha.gxt.widget.core.client.form.FieldSet; import com.sencha.gxt.widget.core.client.form.TextArea; @@ -54,6 +55,7 @@ public class TabularResourceProperties extends FramedPanel { protected TextField agencyField; protected TextField dateField; protected TextArea rightField; + protected CheckBox finalizedField; protected TextField typeField; protected TRMetadataAccordionPanel trMetadataPanel; @@ -125,6 +127,12 @@ public class TabularResourceProperties extends FramedPanel { layoutTabularResource.add(new FieldLabel(rightField, "Rights"), new VerticalLayoutData(1, -1)); + finalizedField = new CheckBox(); + //finalizedField.setBoxLabel(""); + finalizedField.setValue(false); + layoutTabularResource.add(new FieldLabel(finalizedField, "Finalized"), + new VerticalLayoutData(1, -1)); + // Save Button saveButton = new TextButton("Save"); saveButton.setIcon(ResourceBundle.INSTANCE.save()); @@ -174,6 +182,13 @@ public class TabularResourceProperties extends FramedPanel { dateField.setValue(tabResource.getDate()); typeField.setValue(tabResource.getTrId().getTabularResourceType()); rightField.setValue(tabResource.getRight()); + if(tabResource.isFinalized()){ + finalizedField.setEnabled(false); + finalizedField.setValue(true); + } else { + finalizedField.setEnabled(true); + finalizedField.setValue(false); + } } @@ -315,7 +330,8 @@ public class TabularResourceProperties extends FramedPanel { tabResource.setDescription(descriptionField.getValue()); tabResource.setAgency(agencyField.getValue()); tabResource.setRight(rightField.getValue()); - + tabResource.setFinalized(finalizedField.getValue()); + TDGWTServiceAsync.INSTANCE.setTabResourceInformation(tabResource, new AsyncCallback() {