private void setChecked(List<String> tasks) { tasksChecked.setChecked(tasks); if (taskSelectionTreeViewer != null) { taskSelectionTreeViewer.refresh(); } updateOrderedTargets(); updateLaunchConfigurationDialog(); }
/** * Gets tasks selected in the actual GUI widget (rather than from the checked state provider, * because the checked state provider may actually contain task paths strings that don't even * exist in the task tree (anymore). Moreover, when we call this we are about to save the task * tree state, and it would be best to weed out non-existent tasks here. Only the tasks that are * actually selected in the GUI tree (these should be real tasks since they are populated from the * model) will be returned. */ private List<String> getSelectedTasks() { List<String> result = tasksChecked.getChecked(); Set<String> validTasks = getValidTasks(); if (validTasks != null) { result.retainAll(validTasks); } return result; }
/** The target order button has been pressed. Prompt the user to reorder the selected targets. */ private void handleOrderPressed() { GradleTaskOrderDialog dialog = new GradleTaskOrderDialog(getShell(), tasksChecked.toArray()); int ok = dialog.open(); if (ok == Window.OK) { String[] targets = dialog.getTargets(); setChecked(Arrays.asList(targets)); } }