| author | Raksha Vasisht | 2011-09-27 04:11:22 (EDT) |
|---|---|---|
| committer | Raksha Vasisht | 2011-09-27 04:25:47 (EDT) |
| commit | 08752e9a3471ac6b24af9459b276d74e12916921 (patch) (side-by-side diff) | |
| tree | 16a965b5b9e098f6954bf4b8f85cc739918a573f | |
| parent | 4778eb29eb182b5bc283c46e59c6eafac8b2afe1 (diff) | |
| download | eclipse.jdt.ui-08752e9a3471ac6b24af9459b276d74e12916921.zip eclipse.jdt.ui-08752e9a3471ac6b24af9459b276d74e12916921.tar.gz eclipse.jdt.ui-08752e9a3471ac6b24af9459b276d74e12916921.tar.bz2 | |
Fix bug 335224: [JUnit] New JUnit Test Case wizard doesn't store method
stub selection state
2 files changed, 14 insertions, 9 deletions
diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/wizards/MethodStubsSelectionButtonGroup.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/wizards/MethodStubsSelectionButtonGroup.java index 38bd043..bfa5a5d 100644 --- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/wizards/MethodStubsSelectionButtonGroup.java +++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/wizards/MethodStubsSelectionButtonGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -200,7 +200,7 @@ public class MethodStubsSelectionButtonGroup { return null; } - private void doWidgetSelected(SelectionEvent e) { + protected void doWidgetSelected(SelectionEvent e) { Button button= (Button)e.widget; for (int i= 0; i < fButtons.length; i++) { if (fButtons[i] == button) { @@ -218,7 +218,7 @@ public class MethodStubsSelectionButtonGroup { */ public boolean isSelected(int index) { if (index >= 0 && index < fButtonsSelected.length) { - return fButtonsSelected[index] && fButtonsEnabled[index]; + return fButtonsSelected[index]; } return false; } @@ -267,11 +267,7 @@ public class MethodStubsSelectionButtonGroup { Button button= fButtons[index]; if (isOkToUse(button)) { button.setEnabled(enabled); - if (!enabled) { - button.setSelection(false); - } else { - button.setSelection(fButtonsSelected[index]); - } + button.setSelection(fButtonsSelected[index]); } } } diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java index b4f4a62..5d25f53 100644 --- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java +++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseWizardPageOne.java @@ -182,7 +182,16 @@ public class NewTestCaseWizardPageOne extends NewTypeWizardPage { }; enableCommentControl(true); - fMethodStubsButtons= new MethodStubsSelectionButtonGroup(SWT.CHECK, buttonNames, 2); + fMethodStubsButtons= new MethodStubsSelectionButtonGroup(SWT.CHECK, buttonNames, 2) { + /* (non-Javadoc) + * @see org.eclipse.jdt.internal.junit.wizards.MethodStubsSelectionButtonGroup#doWidgetSelected(org.eclipse.swt.events.SelectionEvent) + */ + @Override + protected void doWidgetSelected(SelectionEvent e) { + super.doWidgetSelected(e); + saveWidgetValues(); + } + }; fMethodStubsButtons.setLabelText(WizardMessages.NewTestCaseWizardPageOne_method_Stub_label); fClassToTestCompletionProcessor= new JavaTypeCompletionProcessor(false, false, true); |

