|
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 rcVerifyCheckboxOfSelectedCell(boolean checked) |
| 673 |
throws StepExecutionException { |
| 674 |
Boolean checkSelected = ((Boolean)getEventThreadQueuer().invokeAndWait( |
| 675 |
"rcVerifyTableCheckbox", new IRunnable() { //$NON-NLS-1$ |
| 676 |
public Object run() throws StepExecutionException { |
| 677 |
Cell cell = ((ITableComponent) getComponent()). |
| 678 |
getSelectedCell(); |
| 679 |
TableItem item = getTable().getItem(cell.getRow()); |
| 680 |
return new Boolean(item.getChecked()); |
| 681 |
} |
| 682 |
})); |
| 683 |
|
| 684 |
Verifier.equals(checked, checkSelected.booleanValue()); |
| 685 |
} |
| 686 |
|
| 687 |
/** |
| 688 |
* Verifies whether the checkbox of the cell with the given |
| 689 |
* <code>index</code> in the table is checked |
| 690 |
* |
| 691 |
* @param checked true if checkbox in cell is selected, false otherwise |
| 692 |
* @param index the row-index of the cell in which the checkbox-state should be verified |
| 693 |
*/ |
| 694 |
public void rcVerifyCheckboxByIndex(boolean checked, final int index) { |
| 695 |
|
| 696 |
Boolean checkIndex = ((Boolean)getEventThreadQueuer().invokeAndWait( |
| 697 |
"rcVerifyTableCheckboxIndex", new IRunnable() { //$NON-NLS-1$ |
| 698 |
public Object run() throws StepExecutionException { |
| 699 |
return new Boolean(getTable().getItem(index). |
| 700 |
getChecked()); |
| 701 |
} |
| 702 |
})); |
| 703 |
Verifier.equals(checked, checkIndex.booleanValue()); |
| 704 |
} |
| 705 |
|
| 706 |
/** |
| 707 |
* Verifies whether the checkbox of the cell which contains the <code>value</code> in the |
| 708 |
* table (first column) is checked |
| 709 |
* |
| 710 |
* @param checked true if checkbox in cell is selected, false otherwise |
| 711 |
* @param value the value to search for in the table |
| 712 |
* @param operator the Operator |
| 713 |
*/ |
| 714 |
public void rcVerifyCheckboxByValue(boolean checked, String value, |
| 715 |
String operator) { |
| 716 |
|
| 717 |
ITableComponent adapter = (ITableComponent) getComponent(); |
| 718 |
rcVerifyCheckboxByIndex(checked, |
| 719 |
adapter.getRowFromString(value, operator)); |
| 720 |
} |
| 664 |
} |
721 |
} |