diff --git a/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java b/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java index c6ba28d9b6..54728e75ea 100644 --- a/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java +++ b/ui/src/main/java/org/apache/hop/ui/core/widget/TableView.java @@ -1904,8 +1904,7 @@ public void clearAll(boolean ask) { } if (id == SWT.YES) { - table.removeAll(); - new TableItem(table, SWT.NONE); + removeAll(); if (!readonly) { parent.getDisplay().asyncExec(() -> edit(0, 1)); } @@ -2289,7 +2288,8 @@ public void delSelected() { table.remove(items); if (table.getItemCount() == 0) { - TableItem item = new TableItem(table, SWT.NONE); + removeAll(); + TableItem item = table.getItem(0); // Save undo infomation! String[] stritem = getItemText(item); ta = new ChangeAction(); @@ -2370,7 +2370,8 @@ public void keepSelected() { table.remove(itemsToDelete); if (table.getItemCount() == 0) { - TableItem item = new TableItem(table, SWT.NONE); + removeAll(); + TableItem item = table.getItem(0); // Save undo information! String[] strItem = getItemText(item); ta = new ChangeAction(); @@ -3050,8 +3051,7 @@ public void removeEmptyRows(int column) { } } if (table.getItemCount() == 0) { // At least one empty row! - - new TableItem(table, SWT.NONE); + removeAll(); } } @@ -3529,14 +3529,14 @@ public int getSelectionIndex() { public void remove(int index) { table.remove(index); if (table.getItemCount() == 0) { - new TableItem(table, SWT.NONE); + removeAll(); } } public void remove(int[] index) { table.remove(index); if (table.getItemCount() == 0) { - new TableItem(table, SWT.NONE); + removeAll(); } } @@ -3587,6 +3587,7 @@ public void removeAll() { table.removeAll(); if (table.getItemCount() == 0) { new TableItem(table, SWT.NONE); + table.setItemCount(1); } }