* @return the command to be executed or null if no command was selected for execution.
*/
private String chooseCommand() {
final IPreferenceStore preferenceStore = PydevPlugin.getDefault().getPreferenceStore();
TreeSelectionDialog dialog = new SelectExistingOrCreateNewDialog(PyAction.getShell(), preferenceStore,
DJANGO_CUSTOM_COMMANDS_PREFERENCE_KEY, SHELL_MEMENTO_ID);
dialog.setTitle("Select the command to run or enter a new command");
dialog.setMessage("Select the command to run or enter a new command");
dialog.setInitialFilter("");
int open = dialog.open();
if (open != Window.OK) {
return null;
}
Object[] result = dialog.getResult();
if (result != null && result.length == 1) {
return result[0].toString();
}
return null;
}