this.selection = selection;
}
@Override
public void run() {
LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(
RunnerPlugin.getRunnerShell(),
getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupId())
);
if (selection.hasExactlyOneNode() && selection.firstNodeHasType(ILaunchNode.class)) {
dialog.setOpenMode(LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
dialog.setInitialSelection(
asStructuredSelection(selection.getFirstNodeAs(ILaunchNode.class).getLaunchConfiguration())
);
}
else {
dialog.setOpenMode(LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED);
}
dialog.open();
}