Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 414672 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/TableTester.java (+57 lines)
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
}
(-)a/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml (-2 / +2 lines)
Lines 234-243 Link Here
234
		<componentClass name="org.eclipse.swt.custom.CTabFolder" />
234
		<componentClass name="org.eclipse.swt.custom.CTabFolder" />
235
	</toolkitComponent>
235
	</toolkitComponent>
236
	
236
	
237
	<toolkitComponent type="org.eclipse.swt.widgets.Table" visible="false">
237
	<toolkitComponent type="org.eclipse.swt.widgets.Table" visible="true">
238
		<realizes>guidancer.concrete.Table</realizes>
238
		<realizes>guidancer.concrete.Table</realizes>
239
		<testerClass>org.eclipse.jubula.rc.swt.tester.TableTester</testerClass>
239
		<testerClass>org.eclipse.jubula.rc.swt.tester.TableTester</testerClass>
240
		<componentClass name="org.eclipse.swt.widgets.Table" />
240
		<componentClass name="org.eclipse.swt.widgets.Table" />
		<action name="CompSystem.VerifyCheckboxOfSelectedCell" changed="1.0">
			<method>rcVerifyCheckboxOfSelectedCell</method>
			<param name="CompSystem.Checked">
				<type>java.lang.Boolean</type>
				<defaultValue>true</defaultValue>
				<valueSet>
					<element name="CompSystem.True" value="true"/>
					<element name="CompSystem.False" value="false"/>
				</valueSet>
			</param>
		</action>
		<action name="CompSystem.VerifyCheckboxOfCellByIndex" changed="1.0">
			<method>rcVerifyCheckboxByIndex</method>
			<param name="CompSystem.Checked">
				<type>java.lang.Boolean</type>
				<defaultValue>true</defaultValue>
				<valueSet>
					<element name="CompSystem.True" value="true"/>
					<element name="CompSystem.False" value="false"/>
				</valueSet>
				</param>
				<param name="CompSystem.IndexOnly">
					<type>java.lang.Integer</type>
				</param>
		</action>
		<action name="CompSystem.VerifyCheckboxOfCellByValue" changed="1.0">
			<method>rcVerifyCheckboxByValue</method>
			<param name="CompSystem.Checked">
				<type>java.lang.Boolean</type>
				<defaultValue>true</defaultValue>
				<valueSet>
					<element name="CompSystem.True" value="true"/>
					<element name="CompSystem.False" value="false"/>
				</valueSet>
			</param>
			<param name="CompSystem.Row">
				<type>java.lang.String</type>
			</param>
			<param name="CompSystem.RowOperator">
				<type>java.lang.String</type>
				<defaultValue>equals</defaultValue>
				<valueSet>
					<element name="CompSystem.Equals" value="equals"/>
					<element name="CompSystem.NotEquals" value="not equals"/>
					<element name="CompSystem.MatchesRegExp" value="matches"/>
					<element name="CompSystem.SimpleMatch" value="simple match"/>
				</valueSet>
			</param>
		</action>
241
	</toolkitComponent>
241
	</toolkitComponent>
242
	
242
	
243
	<toolkitComponent type="org.eclipse.swt.widgets.Tree" observable="false">
243
	<toolkitComponent type="org.eclipse.swt.widgets.Tree" observable="false">
(-)a/org.eclipse.jubula.toolkit.provider.swt/src/org/eclipse/jubula/toolkit/provider/swt/I18nStrings.properties (-2 / +4 lines)
Lines 31-34 org.eclipse.swt.widgets.Link=(SWT) Link Link Here
31
org.eclipse.swt.widgets.Spinner=(SWT) Spinner
31
org.eclipse.swt.widgets.Spinner=(SWT) Spinner
32
org.eclipse.swt.widgets.Slider=(SWT) Slider
32
org.eclipse.swt.widgets.Slider=(SWT) Slider
33
org.eclipse.swt.widgets.Scale=(SWT) Scale
33
org.eclipse.swt.widgets.Scale=(SWT) Scale
34
org.eclipse.swt.widgets.DateTime=(SWT) DateTime
34
org.eclipse.swt.widgets.DateTime=(SWT) DateTime
35
CompSystem.VerifyCheckboxOfSelectedCell=Check Selection of Checkbox in Selected Cell
36
CompSystem.VerifyCheckboxOfCellByIndex=Check Selection of Checkbox in Cell by Index
37
CompSystem.VerifyCheckboxOfCellByValue=Check Selection of Checkbox in Cell by Value
35
- 

Return to bug 414672