+ if (selection.isEmpty()) {\r
+ selectionLayer.clear(false);\r
+ natTable.redraw();\r
+ return;\r
+ }\r
+ List<RowSelectionItem> rowItems = new ArrayList<>(AdaptionUtils.adaptToCollection(selection, RowSelectionItem.class));\r
+ if (rowItems.size() > 0) {\r
+ \r
+ setSelectionExternal(rowItems);\r
+ return;\r
+ }\r
+ Collection<TreeNode> nodes = AdaptionUtils.adaptToCollection(selection, TreeNode.class);\r
+ if (nodes.size() > 0) {\r
+ List<RowSelectionItem> selected = new ArrayList<>();\r
+ int allCols[] = new int[selectionLayer.getColumnCount()];\r
+ for (int i = 0; i < allCols.length; i++)\r
+ allCols[i] = i;\r
+ for (TreeNode n : nodes) {\r
+ selected.add(new RowSelectionItem(n, n.listIndex, allCols));\r
+ }\r
+ setSelectionExternal(selected);\r
+ return;\r
+ }\r