Minor update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@101818 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ce2cb781bf
commit
5bb7d4f56a
|
@ -49,7 +49,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected static final String WIDTH = "640px";
|
protected static final String WIDTH = "640px";
|
||||||
protected static final String HEIGHT = "520px";
|
protected static final String HEIGHT = "520px";
|
||||||
protected static final int LABELWIDTH = 140;
|
protected static final int LABELWIDTH = 120;
|
||||||
|
|
||||||
protected EventBus eventBus;
|
protected EventBus eventBus;
|
||||||
protected ChangeColumnTypeDialog parent;
|
protected ChangeColumnTypeDialog parent;
|
||||||
|
@ -65,6 +65,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
|
|
||||||
protected LabelColumnSession labelColumnSession;
|
protected LabelColumnSession labelColumnSession;
|
||||||
private boolean updateStatus;
|
private boolean updateStatus;
|
||||||
|
private VerticalLayoutContainer v;
|
||||||
|
|
||||||
public LabelColumnPanel(TRId trId, String columnName, EventBus eventBus) {
|
public LabelColumnPanel(TRId trId, String columnName, EventBus eventBus) {
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
|
@ -147,6 +148,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
columnsContainer.add(columnsLayoutContainer);
|
columnsContainer.add(columnsLayoutContainer);
|
||||||
|
|
||||||
addFields();
|
addFields();
|
||||||
|
|
||||||
columnsContainer.forceLayout();
|
columnsContainer.forceLayout();
|
||||||
|
|
||||||
change = new TextButton("Change");
|
change = new TextButton("Change");
|
||||||
|
@ -162,12 +164,11 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
v=new VerticalLayoutContainer();
|
||||||
v.setScrollMode(ScrollMode.AUTO);
|
v.setScrollMode(ScrollMode.AUTO);
|
||||||
|
v.add(columnsContainer, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
v.add(columnsContainer, new VerticalLayoutData(1, -1, new Margins(1)));
|
|
||||||
v.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
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(0)));
|
||||||
|
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
|
||||||
|
@ -175,7 +176,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
|
|
||||||
protected void addFields() {
|
protected void addFields() {
|
||||||
VerticalLayoutData layoutData = new VerticalLayoutData(1, -1,
|
VerticalLayoutData layoutData = new VerticalLayoutData(1, -1,
|
||||||
new Margins(1));
|
new Margins(0));
|
||||||
|
|
||||||
ArrayList<FieldLabel> fields = generateFields();
|
ArrayList<FieldLabel> fields = generateFields();
|
||||||
for (FieldLabel fl : fields) {
|
for (FieldLabel fl : fields) {
|
||||||
|
@ -183,6 +184,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
columnsLayoutContainer.onResize();
|
columnsLayoutContainer.onResize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ArrayList<FieldLabel> generateFields() {
|
protected ArrayList<FieldLabel> generateFields() {
|
||||||
|
@ -195,8 +197,8 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
TextField text = new TextField();
|
TextField text = new TextField();
|
||||||
text.setValue(col.getLabel());
|
text.setValue(col.getLabel());
|
||||||
String lab=col.getLabel();
|
String lab=col.getLabel();
|
||||||
if(lab.length()>23){
|
if(lab.length()>19){
|
||||||
lab=lab.substring(0, 21);
|
lab=lab.substring(0, 17);
|
||||||
lab=lab+"...";
|
lab=lab+"...";
|
||||||
}
|
}
|
||||||
textLabel = new FieldLabel(text, lab);
|
textLabel = new FieldLabel(text, lab);
|
||||||
|
@ -306,13 +308,26 @@ public class LabelColumnPanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(String taskId) {
|
public void onSuccess(String taskId) {
|
||||||
openMonitorDialog(taskId);
|
UtilsGXT3
|
||||||
|
.info("Success", "Updated labels");
|
||||||
|
syncOpComplete();
|
||||||
|
|
||||||
|
//openMonitorDialog(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void syncOpComplete(){
|
||||||
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
||||||
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
|
ChangeTableRequestType.CHANGECOLUMNLABEL, trId, why);
|
||||||
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
parent.close();
|
parent.close();
|
||||||
|
|
Loading…
Reference in New Issue