private boolean canDeploySelection(Set<BootDashElement> selection) { if (selection.isEmpty()) { // Careful... don't return 'true' if nothing is selected. return false; } for (BootDashElement e : selection) { if (!e.getBootDashModel().getRunTarget().canDeployAppsFrom()) { return false; } } return true; }
@Override public int compare(Viewer viewer, Object e1, Object e2) { if (e1 instanceof BootDashModel && e2 instanceof BootDashModel) { return this.viewModel.getModelComparator().compare((BootDashModel) e1, (BootDashModel) e2); } else if (e1 instanceof BootDashElement && e2 instanceof BootDashElement) { BootDashElement bde1 = (BootDashElement) e1; BootDashElement bde2 = (BootDashElement) e2; if (bde1.getBootDashModel() == bde2.getBootDashModel()) { Comparator<BootDashElement> comparator = bde1.getBootDashModel().getElementComparator(); if (comparator != null) { return comparator.compare(bde1, bde2); } } } return super.compare(viewer, e1, e2); }
@Override public Object[] getElements(Object inputElement) { if (inputElement instanceof BootDashElement) { BootDashElement el = (BootDashElement) inputElement; List<RequestMapping> elements = el.getLiveRequestMappings(); if (elements != null) { return elements.toArray(); } else { // null means we couldn't determine the request mappings. return new Object[] { "'" + el.getName() + "' must be running...", "and the actuator 'mappings' ...", "endpoint must be enabled ...", "to obtain request mappings.", }; } } return NO_ELEMENTS; }