diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/LabelColumnPanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/LabelColumnPanel.java index fed90d1..8766160 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/LabelColumnPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/LabelColumnPanel.java @@ -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 fields = generateFields(); for (FieldLabel fl : fields) { @@ -183,6 +184,7 @@ public class LabelColumnPanel extends FramedPanel implements } columnsLayoutContainer.onResize(); + } protected ArrayList 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();