|
Lines 23-28
import org.eclipse.jubula.rc.common.implclasses.table.Cell;
Link Here
|
| 23 |
import org.eclipse.jubula.rc.common.tester.AbstractTableTester; |
23 |
import org.eclipse.jubula.rc.common.tester.AbstractTableTester; |
| 24 |
import org.eclipse.jubula.rc.common.tester.adapter.interfaces.ITableComponent; |
24 |
import org.eclipse.jubula.rc.common.tester.adapter.interfaces.ITableComponent; |
| 25 |
import org.eclipse.jubula.rc.common.tester.adapter.interfaces.ITextInputComponent; |
25 |
import org.eclipse.jubula.rc.common.tester.adapter.interfaces.ITextInputComponent; |
|
|
26 |
import org.eclipse.jubula.rc.common.util.Verifier; |
| 26 |
import org.eclipse.jubula.rc.swt.driver.DragAndDropHelperSwt; |
27 |
import org.eclipse.jubula.rc.swt.driver.DragAndDropHelperSwt; |
| 27 |
import org.eclipse.jubula.rc.swt.tester.adapter.StyledTextAdapter; |
28 |
import org.eclipse.jubula.rc.swt.tester.adapter.StyledTextAdapter; |
| 28 |
import org.eclipse.jubula.rc.swt.tester.adapter.TableAdapter; |
29 |
import org.eclipse.jubula.rc.swt.tester.adapter.TableAdapter; |
|
Lines 661-664
public class TableTester extends AbstractTableTester {
Link Here
|
| 661 |
pressOrReleaseModifiers(dndHelper.getModifier(), false); |
662 |
pressOrReleaseModifiers(dndHelper.getModifier(), false); |
| 662 |
} |
663 |
} |
| 663 |
} |
664 |
} |
|
|
665 |
|
| 666 |
/** |
| 667 |
* Verifies whether the checkbox of the first selected cell in the table is checked |
| 668 |
* |
| 669 |
* @param checked true if checkbox in cell is selected, false otherwise |
| 670 |
* @throws StepExecutionException If no cell is selected or the verification fails. |
| 671 |
*/ |
| 672 |
public void rcVerifyCheckboxOfSelectedRow(boolean checked) |
| 673 |
throws StepExecutionException { |
| 674 |
|
| 675 |
int row = ((ITableComponent) getComponent()).getSelectedCell().getRow(); |
| 676 |
verifyCheckboxInRow(checked, row); |
| 677 |
} |
| 678 |
|
| 679 |
/** |
| 680 |
* Verifies whether the checkbox of the row with the given |
| 681 |
* <code>index</code> is checked |
| 682 |
* |
| 683 |
* @param checked true if checkbox in cell is selected, false otherwise |
| 684 |
* @param row the row-index of the cell in which the checkbox-state should be verified |
| 685 |
*/ |
| 686 |
public void verifyCheckboxInRow(boolean checked, final int row) { |
| 687 |
|
| 688 |
Boolean checkIndex = ((Boolean)getEventThreadQueuer().invokeAndWait( |
| 689 |
"rcVerifyTableCheckboxIndex", new IRunnable() { //$NON-NLS-1$ |
| 690 |
public Object run() throws StepExecutionException { |
| 691 |
Table table = getTable(); |
| 692 |
if ((table.getStyle() & SWT.CHECK) == 0) { |
| 693 |
throw new StepExecutionException( |
| 694 |
"No checkbox found", //$NON-NLS-1$ |
| 695 |
EventFactory.createActionError( |
| 696 |
TestErrorEvent.CHECKBOX_NOT_FOUND)); |
| 697 |
} |
| 698 |
return new Boolean(table.getItem(row). |
| 699 |
getChecked()); |
| 700 |
} |
| 701 |
})); |
| 702 |
Verifier.equals(checked, checkIndex.booleanValue()); |
| 703 |
} |
| 704 |
|
| 705 |
/** |
| 706 |
* Verifies whether the checkbox of the cell under the Mouse Pointer |
| 707 |
* is checked |
| 708 |
* |
| 709 |
* @param checked true if checkbox in cell is selected, false otherwise |
| 710 |
*/ |
| 711 |
public void rcVerifyCheckboxOfRowAtMousePosition(boolean checked) { |
| 712 |
int row = getCellAtMousePosition().getRow(); |
| 713 |
verifyCheckboxInRow(checked, row); |
| 714 |
} |
| 664 |
} |
715 |
} |