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 {
|
||||
protected static final String WIDTH = "640px";
|
||||
protected static final String HEIGHT = "520px";
|
||||
protected static final int LABELWIDTH = 140;
|
||||
protected static final int LABELWIDTH = 120;
|
||||
|
||||
protected EventBus eventBus;
|
||||
protected ChangeColumnTypeDialog parent;
|
||||
|
@ -65,6 +65,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
|
||||
protected LabelColumnSession labelColumnSession;
|
||||
private boolean updateStatus;
|
||||
private VerticalLayoutContainer v;
|
||||
|
||||
public LabelColumnPanel(TRId trId, String columnName, EventBus eventBus) {
|
||||
this.trId = trId;
|
||||
|
@ -147,6 +148,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
columnsContainer.add(columnsLayoutContainer);
|
||||
|
||||
addFields();
|
||||
|
||||
columnsContainer.forceLayout();
|
||||
|
||||
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.add(columnsContainer, new VerticalLayoutData(1, -1, new Margins(1)));
|
||||
v.add(columnsContainer, new VerticalLayoutData(1, -1, new Margins(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();
|
||||
|
||||
|
@ -175,7 +176,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
|
||||
protected void addFields() {
|
||||
VerticalLayoutData layoutData = new VerticalLayoutData(1, -1,
|
||||
new Margins(1));
|
||||
new Margins(0));
|
||||
|
||||
ArrayList<FieldLabel> fields = generateFields();
|
||||
for (FieldLabel fl : fields) {
|
||||
|
@ -183,6 +184,7 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
|
||||
}
|
||||
columnsLayoutContainer.onResize();
|
||||
|
||||
}
|
||||
|
||||
protected ArrayList<FieldLabel> generateFields() {
|
||||
|
@ -195,8 +197,8 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
TextField text = new TextField();
|
||||
text.setValue(col.getLabel());
|
||||
String lab=col.getLabel();
|
||||
if(lab.length()>23){
|
||||
lab=lab.substring(0, 21);
|
||||
if(lab.length()>19){
|
||||
lab=lab.substring(0, 17);
|
||||
lab=lab+"...";
|
||||
}
|
||||
textLabel = new FieldLabel(text, lab);
|
||||
|
@ -306,13 +308,26 @@ public class LabelColumnPanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
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() {
|
||||
if (parent != null) {
|
||||
parent.close();
|
||||
|
|
Loading…
Reference in New Issue