Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-information-widget@96048 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-23 14:16:27 +00:00
parent 1f51d4fe21
commit d0162b8fdc
1 changed files with 20 additions and 4 deletions

View File

@ -17,6 +17,8 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.type.WidgetRequestTyp
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
@ -128,11 +130,21 @@ public class TabularResourceProperties extends FramedPanel {
new VerticalLayoutData(1, -1));
finalizedField = new CheckBox();
//finalizedField.setBoxLabel("");
// finalizedField.setBoxLabel("");
finalizedField.setValue(false);
finalizedField.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
if (event.getValue()) {
info("Attention",
"Attention, a tabular resource set to finalize can not be modified!");
}
}
});
layoutTabularResource.add(new FieldLabel(finalizedField, "Finalized"),
new VerticalLayoutData(1, -1));
// Save Button
saveButton = new TextButton("Save");
saveButton.setIcon(ResourceBundle.INSTANCE.save());
@ -182,7 +194,7 @@ public class TabularResourceProperties extends FramedPanel {
dateField.setValue(tabResource.getDate());
typeField.setValue(tabResource.getTrId().getTabularResourceType());
rightField.setValue(tabResource.getRight());
if(tabResource.isFinalized()){
if (tabResource.isFinalized()) {
finalizedField.setEnabled(false);
finalizedField.setValue(true);
} else {
@ -331,7 +343,7 @@ public class TabularResourceProperties extends FramedPanel {
tabResource.setAgency(agencyField.getValue());
tabResource.setRight(rightField.getValue());
tabResource.setFinalized(finalizedField.getValue());
TDGWTServiceAsync.INSTANCE.setTabResourceInformation(tabResource,
new AsyncCallback<Void>() {
@ -353,6 +365,10 @@ public class TabularResourceProperties extends FramedPanel {
+ tabResource);
info("Proprerties",
"Tabular Resource properties are set");
if(finalizedField.getValue()){
finalizedField.setEnabled(false);
finalizedField.setValue(true);
}
}