PyEdit pyEdit = getPyEdit();
final Tuple<String, IInterpreterManager> launchConfigurationTypeAndInterpreterManager = this
.getLaunchConfigurationTypeAndInterpreterManager(pyEdit, true);
final DialogMemento memento = new DialogMemento(getShell(),
"org.python.pydev.debug.ui.actions.RunEditorAsCustomUnitTestAction");
SimpleNode ast = pyEdit.getAST();
TreeSelectionDialog dialog = new TreeSelectionDialog(getShell(), new SelectTestLabelProvider(),
new SelectTestTreeContentProvider()) {
Link configTestRunner;
public boolean close() {
memento.writeSettings(getShell());
return super.close();
}
public Control createDialogArea(Composite parent) {
memento.readSettings();
Control ret = super.createDialogArea(parent);
this.text.addKeyListener(new KeyListener() {
public void keyReleased(KeyEvent e) {
}
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.CR || e.keyCode == SWT.LF || e.keyCode == SWT.KEYPAD_CR) {
okPressed();
}
}
});
return ret;
}
/* (non-Javadoc)
* @see org.python.pydev.ui.dialogs.TreeSelectionDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createButtonBar(Composite parent) {
configTestRunner = new Link(parent, SWT.PUSH);
configTestRunner.setText(" <a>Configure test runner</a>");
configTestRunner.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
PyUnitPrefsPage2.showPage();
}
});
return configTestRunner;
}
protected Point getInitialSize() {
return memento.getInitialSize(super.getInitialSize(), getShell());
}
protected Point getInitialLocation(Point initialSize) {
return memento.getInitialLocation(initialSize, super.getInitialLocation(initialSize), getShell());
}
/*
* @see SelectionStatusDialog#computeResult()
*/