diff --git a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java index 9bd77ff..b73f53d 100644 --- a/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/tablewidget/client/rows/EditRowDialog.java @@ -26,14 +26,21 @@ public class EditRowDialog extends Window { protected RowRaw row; protected DeleteRowsSession deleteRowsSession; protected DeleteRowsProgressDialog deleteRowsProgressDialog; - + + + /** + * Edit selected row + * + * @param trId + * @param row + * @param eventBus + */ public EditRowDialog(TRId trId, RowRaw row, EventBus eventBus) { this.trId = trId; this.row = row; this.eventBus = eventBus; if (row == null) { - UtilsGXT3.alert("Attentions", - "No row selected"); + UtilsGXT3.alert("Attentions", "No row selected"); } else { initWindow(); EditRowPanel editRowPanel = new EditRowPanel(this, trId, row, @@ -42,6 +49,21 @@ public class EditRowDialog extends Window { } } + /** + * Add a new row to the table + * + * @param trId + * @param eventBus + */ + public EditRowDialog(TRId trId, EventBus eventBus) { + this.trId = trId; + this.eventBus = eventBus; + initWindow(); + EditRowPanel editRowPanel = new EditRowPanel(this, trId, eventBus); + add(editRowPanel); + + } + protected void initWindow() { setWidth(WIDTH); setHeight(HEIGHT);