Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@91400 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
62fccae326
commit
3c9e3293ce
|
@ -63,7 +63,7 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
protected ComboBox<ColumnData> comboColumn = null;
|
protected ComboBox<ColumnData> comboColumn = null;
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
|
|
||||||
protected TextButton delete;
|
protected TextButton change;
|
||||||
|
|
||||||
protected LabelColumnSession labelColumnSession;
|
protected LabelColumnSession labelColumnSession;
|
||||||
protected LabelColumnProgressDialog labelColumnProgressDialog;
|
protected LabelColumnProgressDialog labelColumnProgressDialog;
|
||||||
|
@ -131,9 +131,11 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
comboColumn.setEditable(false);
|
comboColumn.setEditable(false);
|
||||||
comboColumn.setTriggerAction(TriggerAction.ALL);
|
comboColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
|
TextField label = new TextField();
|
||||||
|
label.setAllowBlank(false);
|
||||||
|
|
||||||
delete=new TextButton("Change");
|
change=new TextButton("Change");
|
||||||
delete.addSelectHandler(new SelectHandler() {
|
change.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
onLabelColumn();
|
onLabelColumn();
|
||||||
|
@ -144,7 +146,8 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
||||||
-1));
|
-1));
|
||||||
v.add(delete, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
v.add(new FieldLabel(label, "Label"), new VerticalLayoutData(1, -1));
|
||||||
|
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||||
add(v, new VerticalLayoutData(-1, -1, new Margins()));
|
add(v, new VerticalLayoutData(-1, -1, new Margins()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -218,7 +221,9 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
Log.debug("ColumnData: " + cd.toString());
|
Log.debug("ColumnData: " + cd.toString());
|
||||||
labelColumnSession = new LabelColumnSession();
|
labelColumnSession = new LabelColumnSession();
|
||||||
labelColumnSession.setColumnData(cd);
|
labelColumnSession.setColumnData(cd);
|
||||||
|
labelColumnSession.setLabel(cd.getLabel());
|
||||||
comboColumn.setValue(cd);
|
comboColumn.setValue(cd);
|
||||||
|
label.setValue(cd.getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(TRId trId, String columnName) {
|
public void update(TRId trId, String columnName) {
|
||||||
|
@ -231,20 +236,25 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
ColumnData columnData = comboColumn.getCurrentValue();
|
ColumnData columnData = comboColumn.getCurrentValue();
|
||||||
if(columnData!=null){
|
if(columnData!=null){
|
||||||
callDeleteColumn();
|
String lab= label.getCurrentValue();
|
||||||
|
if(lab!=null && !lab.isEmpty()){
|
||||||
|
callLabelColumn();
|
||||||
|
} else {
|
||||||
|
alert("Attention", "Insert a valid label!");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
alert("Attention", "Select a column!");
|
alert("Attention", "Select a column!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void callDeleteColumn() {
|
private void callLabelColumn() {
|
||||||
TDGWTServiceAsync.INSTANCE.startLabelColumn(
|
TDGWTServiceAsync.INSTANCE.startLabelColumn(
|
||||||
labelColumnSession, new AsyncCallback<Void>() {
|
labelColumnSession, new AsyncCallback<Void>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.debug("Change The Column Label Error: "
|
Log.debug("Change The Column Label Error: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
alert("Delete Column Type Error ",
|
alert("Error Changing The Column Label",
|
||||||
"Error in invocation of Change The Column Label operation!");
|
"Error in invocation of Change The Column Label operation!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue