List<AnAction> () { List<AnAction> result = new ArrayList<>(); Sorter[] sorters = myTreeModel.getSorters(); for (final Sorter sorter : sorters) { if (sorter.isVisible()) { result.add(new TreeActionWrapper(sorter, this)); } } return result; }