SelectionInfo (final AbstractProjectViewPane viewPane) { if (viewPane == null) { return new SelectionInfo(ArrayUtilRt.EMPTY_OBJECT_ARRAY); } List<Object> selectedElements = Collections.emptyList(); TreePath[] selectionPaths = viewPane.getSelectionPaths(); if (selectionPaths != null) { selectedElements = new ArrayList<>(); for (TreePath path : selectionPaths) { NodeDescriptor<?> descriptor = TreeUtil.getLastUserObject(NodeDescriptor.class, path); if (descriptor != null) { selectedElements.add(descriptor.getElement()); } } } return new SelectionInfo(selectedElements.toArray()); }