|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.softevo.ample.ui.SelectTestsDialog
public class SelectTestsDialog
Dialog to choose tests on which Ample is to be executed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window |
---|
org.eclipse.jface.window.Window.IExceptionHandler |
Field Summary | |
---|---|
private org.eclipse.swt.graphics.Image |
failingTestIcon
Icon displayed to the left of the "failing test" label. |
private org.eclipse.swt.widgets.List |
failingTestsList
List control that shows the names of the failing tests. |
private static int |
MARGINS
Margins, in pixels, between the controls and the border of the dialog. |
private org.eclipse.swt.graphics.Image |
passingTestIcon
Icon displayed to the left of the "passing tests" label. |
private org.eclipse.swt.widgets.List |
passingTestsList
List control that shows the names of the passing tests. |
private org.eclipse.swt.widgets.Button |
selectAllPassingCheck
Checkbox used to select all passing tests. |
private org.eclipse.jdt.internal.junit.ui.TestRunInfo |
selectedFailingTest
Id of the failing test selected by the user for instrumentation. |
private org.eclipse.jdt.internal.junit.ui.TestRunInfo[] |
selectedPassingTests
List of passing runs selected by the user. |
private static int |
SPACING
Spacing, in pixels, between controls in the dialog. |
Fields inherited from class org.eclipse.jface.dialogs.Dialog |
---|
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS |
Fields inherited from class org.eclipse.jface.window.Window |
---|
CANCEL, OK |
Constructor Summary | |
---|---|
SelectTestsDialog(org.eclipse.swt.widgets.Shell parentShell,
int failingTestIndex)
Initializes a new instance of SelectTestsDialog . |
Method Summary | |
---|---|
private void |
allPassingClicked()
Updates the dialog when the checkbox for selecting all passing tests is clicked on. |
protected void |
configureShell(org.eclipse.swt.widgets.Shell newShell)
|
protected org.eclipse.swt.widgets.Button |
createButton(org.eclipse.swt.widgets.Composite parent,
int id,
java.lang.String label,
boolean defaultButton)
Creates a new button with a given ID. |
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent)
|
private static org.eclipse.swt.widgets.Label |
createLabelWithIcon(org.eclipse.swt.widgets.Composite dialogArea,
org.eclipse.swt.graphics.Image icon)
Creates a composite control that contains a label with an icon on its left. |
private static java.lang.String |
createTestName(org.eclipse.jdt.internal.junit.ui.TestRunInfo testInfo)
Creates a single-line description of a test run to be displayed to the user. |
private void |
fillListWithTests(org.eclipse.swt.widgets.List aTestList,
java.util.ArrayList aTestInfos,
org.eclipse.jdt.internal.junit.ui.TestRunInfo selectedTest)
Fills a given list widget with a the names of a specified list of tests. |
org.eclipse.jdt.internal.junit.ui.TestRunInfo |
getSelectedFailingTest()
Gets the selected failing test. |
org.eclipse.jdt.internal.junit.ui.TestRunInfo[] |
getSelectedPassingTests()
Gets the selected passing tests. |
protected void |
okPressed()
Notifies that the OK button of this dialog has been pressed. |
private void |
updateSelectionPassing()
Updates the dialog when the user changes the selection of passing tests. |
Methods inherited from class org.eclipse.jface.dialogs.Dialog |
---|
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText |
Methods inherited from class org.eclipse.jface.window.Window |
---|
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int SPACING
private static final int MARGINS
private org.eclipse.swt.widgets.List failingTestsList
Note that such a control might not be created.
private org.eclipse.swt.widgets.List passingTestsList
Note that such a control might not be created.
private org.eclipse.swt.widgets.Button selectAllPassingCheck
Note that this control is created only when passingTestsList
is created.
passingTestsList
private org.eclipse.swt.graphics.Image failingTestIcon
private org.eclipse.swt.graphics.Image passingTestIcon
private org.eclipse.jdt.internal.junit.ui.TestRunInfo selectedFailingTest
private org.eclipse.jdt.internal.junit.ui.TestRunInfo[] selectedPassingTests
Constructor Detail |
---|
public SelectTestsDialog(org.eclipse.swt.widgets.Shell parentShell, int failingTestIndex)
SelectTestsDialog
.
parentShell
- Owner of this dialog window.failingTestIndex
- Index of failing test initially selected.Method Detail |
---|
public org.eclipse.jdt.internal.junit.ui.TestRunInfo getSelectedFailingTest()
This method must be called only after the user has pressed the OK button of this dialog.
TestRunInfo
corresponding to the failing test the user has selected.public org.eclipse.jdt.internal.junit.ui.TestRunInfo[] getSelectedPassingTests()
This method must be called only after the user has pressed the OK button of this dialog.
TestRunInfo
s corresponding to the passing tests the user has
selected.protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
configureShell
in class org.eclipse.jface.window.Window
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea
in class org.eclipse.jface.dialogs.Dialog
protected org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent, int id, java.lang.String label, boolean defaultButton)
This method overrides Dialog.createButton(org.eclipse.swt.widgets.Composite, int, java.lang.String, boolean)
by additionally disabling the OK button if the user must choose passing tests before pressing it.
createButton
in class org.eclipse.jface.dialogs.Dialog
protected void okPressed()
okPressed
in class org.eclipse.jface.dialogs.Dialog
private static org.eclipse.swt.widgets.Label createLabelWithIcon(org.eclipse.swt.widgets.Composite dialogArea, org.eclipse.swt.graphics.Image icon)
dialogArea
- Parent control of the newly creted composite.icon
- Icon to be displayed to the left of the label.
Label
.private static java.lang.String createTestName(org.eclipse.jdt.internal.junit.ui.TestRunInfo testInfo)
testInfo
- Test run info that will be shown.
String
representation of the given test info.private void updateSelectionPassing()
This method makes sure the dialog's OK button is enabled only if enough passing tests are selected by the user.
private void fillListWithTests(org.eclipse.swt.widgets.List aTestList, java.util.ArrayList aTestInfos, org.eclipse.jdt.internal.junit.ui.TestRunInfo selectedTest)
aTestList
- List widget to be filled with test names.aTestInfos
- List of tests which names are to be added to the list.selectedTest
- Test that will be initially selected. Set this parameter to null
if
no test is to be initially selected.private void allPassingClicked()
This method selects / deselects all items in the list of the passing tests and updates the "OK" button of the dialog accordingly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |