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 (-1 / +115 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 306-312 public class TableTester extends AbstractTableTester { Link Here
306
                "getCellBounds", //$NON-NLS-1$
307
                "getCellBounds", //$NON-NLS-1$
307
                new IRunnable() {
308
                new IRunnable() {
308
                    public Object run() {
309
                    public Object run() {
309
                        TableItem ti = table.getItem(row);
310
                        TableItem ti = table.getItem(row); 
310
                        int column = (table.getColumnCount() > 0 || col > 0) 
311
                        int column = (table.getColumnCount() > 0 || col > 0) 
311
                            ? col : 0;
312
                            ? col : 0;
312
                        org.eclipse.swt.graphics.Rectangle r = 
313
                        org.eclipse.swt.graphics.Rectangle r = 
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 in the row of the selected cell 
668
     * is checked
669
     * 
670
     * @param checked true if checkbox in cell should be selected, false otherwise
671
     * @throws StepExecutionException If no cell is selected or the verification fails.
672
     */
673
    public void rcVerifyCheckboxInSelectedRow(boolean checked)
674
        throws StepExecutionException {
675
        int row = ((ITableComponent) getComponent()).getSelectedCell().getRow();
676
        verifyCheckboxInRow(checked, row);
677
    }
678
    
679
    /**
680
     * Verifies whether the checkbox in the row under the mouse pointer is checked
681
     * 
682
     * @param checked true if checkbox in cell is selected, false otherwise
683
     */
684
    public void rcVerifyCheckboxInRowAtMousePosition(boolean checked) {
685
        int row = getCellAtMousePosition().getRow();
686
        verifyCheckboxInRow(checked, row);
687
    }
688
    
689
    /**
690
     * Verifies whether the checkbox in the row with the given
691
     * <code>index</code> is checked
692
     * 
693
     * @param checked true if checkbox in cell is selected, false otherwise
694
     * @param row the row-index of the cell in which the checkbox-state should be verified
695
     */
696
    private void verifyCheckboxInRow(boolean checked, final int row) {
697
        Boolean checkIndex = ((Boolean)getEventThreadQueuer().invokeAndWait(
698
                "rcVerifyTableCheckboxIndex", new IRunnable() { //$NON-NLS-1$
699
                    public Object run() throws StepExecutionException {
700
                        Table table = getTable();
701
                        if ((table.getStyle() & SWT.CHECK) == 0) {
702
                            throw new StepExecutionException(
703
                                    "No checkbox found", //$NON-NLS-1$
704
                                    EventFactory.createActionError(
705
                                            TestErrorEvent.CHECKBOX_NOT_FOUND));
706
                        }
707
                        return new Boolean(table.getItem(row).
708
                                getChecked());
709
                    }
710
                }));
711
        Verifier.equals(checked, checkIndex.booleanValue());
712
    }
713
714
    /**
715
     * Toggles the checkbox in the row under the Mouse Pointer 
716
     */
717
    public void rcToggleCheckboxInRowAtMousePosition() {
718
        toggleCheckboxInRow(getCellAtMousePosition().getRow());
719
    }
720
    
721
    /**
722
     * Toggles the checkbox in the selected row
723
     */
724
    public void rcToggleCheckboxInSelectedRow() {
725
        int row = ((Integer) getEventThreadQueuer().invokeAndWait(
726
                "get Selection index", new IRunnable() { //$NON-NLS-1$
727
                    public Object run() throws StepExecutionException {
728
                        return new Integer(getTable().getSelectionIndex());
729
                    }
730
                })).intValue();
731
        toggleCheckboxInRow(row);
732
    }
733
734
    /**
735
     * Toggles the checkbox in the row with the given index
736
     * @param row the index
737
     */
738
    private void toggleCheckboxInRow(final int row) {
739
740
        if (row == -1) {
741
            getEventThreadQueuer().invokeAndWait(
742
                "No Selection", new IRunnable() { //$NON-NLS-1$
743
                    public Object run() throws StepExecutionException {
744
                        throw new StepExecutionException(
745
                            "No Selection found ", //$NON-NLS-1$
746
                            EventFactory.createActionError(
747
                                TestErrorEvent.NO_SELECTION));
748
                    }
749
                });
750
        }
751
        
752
        ((ITableComponent) getComponent()).scrollCellToVisible(row, 0);
753
754
        final Table table = getTable();
755
        
756
        org.eclipse.swt.graphics.Rectangle itemBounds =
757
            (org.eclipse.swt.graphics.Rectangle) getEventThreadQueuer().
758
                invokeAndWait(
759
                    "getTableItem",  //$NON-NLS-1$
760
                    new IRunnable() {
761
                        public Object run() throws StepExecutionException {
762
                            return table.getItem(row).getBounds();
763
                        }
764
                    });
765
        
766
        int itemHeight = itemBounds.height;
767
        
768
        // Creates a Rectangle with bounds around the checkbox of the row
769
        org.eclipse.swt.graphics.Rectangle cbxBounds = 
770
                new org.eclipse.swt.graphics.Rectangle(0,
771
                        itemBounds.y, itemBounds.x, itemHeight);
772
        
773
        // Performs a click in the middle of the Rectangle
774
        getRobot().click(table, cbxBounds, ClickOptions.create().left().
775
                setScrollToVisible(false),
776
                itemBounds.x / 2, true, itemHeight / 2, true);
777
    }
664
}
778
}
(-)a/org.eclipse.jubula.toolkit.provider.concrete/resources/xml/ComponentConfiguration.xml (-2 / +2 lines)
Lines 1976-1983 Link Here
1976
				<type>java.lang.Integer</type>
1976
				<type>java.lang.Integer</type>
1977
				<defaultValue>100</defaultValue>
1977
				<defaultValue>100</defaultValue>
1978
			</param>
1978
			</param>
1979
		</action>
1979
		</action>
		
1980
		
1980
		<action name="CompSystem.VerifyCheckboxInSelectedRow" changed="4.5">
			<method>rcVerifyCheckboxInSelectedRow</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.VerifyCheckboxOfRowAtMousePosition" changed="4.5">
			<method>rcVerifyCheckboxInRowAtMousePosition</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.ToggleCheckboxInSelectedRow" changed="4.5">
			<method>rcToggleCheckboxInSelectedRow</method>
		</action>
		
		<action name="CompSystem.ToggleCheckboxOfRowAtMousePosition" changed="4.5">
			<method>rcToggleCheckboxInRowAtMousePosition</method>
		</action>
1981
	</concreteComponent>
1981
	</concreteComponent>
1982
	
1982
	
1983
	<concreteComponent type="guidancer.concrete.TextComponent">
1983
	<concreteComponent type="guidancer.concrete.TextComponent">
(-)a/org.eclipse.jubula.toolkit.provider.concrete/src/org/eclipse/jubula/toolkit/provider/concrete/I18nStrings.properties (-1 / +5 lines)
Lines 73-76 CompSystem.Value1=Value 1 Link Here
73
CompSystem.Value2=Value 2
73
CompSystem.Value2=Value 2
74
CompSystem.ValueOperator=Value Operator
74
CompSystem.ValueOperator=Value Operator
75
CompSystem.PrepareForShutdown=Prepare for AUT termination
75
CompSystem.PrepareForShutdown=Prepare for AUT termination
76
CompSystem.SyncShutdownAndRestart=Synchronize termination and re-start of AUT
76
CompSystem.SyncShutdownAndRestart=Synchronize termination and re-start of AUT
77
CompSystem.VerifyCheckboxInSelectedRow=Check Selection of Checkbox in Selected Row
78
CompSystem.VerifyCheckboxOfRowAtMousePosition=Check Selection of Checkbox at Mouse Position
79
CompSystem.ToggleCheckboxInSelectedRow=Toggle Checkbox in Selected Row
80
CompSystem.ToggleCheckboxOfRowAtMousePosition=Toggle Checkbox at Mouse Position
(-)a/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml (-2 / +1 lines)
Lines 229-236 Link Here
229
	
229
	
230
	<toolkitComponent type="org.eclipse.swt.widgets.Table" visible="false">
230
	<toolkitComponent type="org.eclipse.swt.widgets.Table" visible="false">
231
		<realizes>guidancer.concrete.Table</realizes>
231
		<realizes>guidancer.concrete.Table</realizes>
232
		<testerClass>org.eclipse.jubula.rc.swt.tester.TableTester</testerClass>
232
		<testerClass>org.eclipse.jubula.rc.swt.tester.TableTester</testerClass>
		<componentClass name="org.eclipse.swt.widgets.Table" />
233
		<componentClass name="org.eclipse.swt.widgets.Table" />
234
	</toolkitComponent>
233
	</toolkitComponent>
235
	
234
	
236
	<toolkitComponent type="org.eclipse.swt.widgets.Tree" observable="false">
235
	<toolkitComponent type="org.eclipse.swt.widgets.Tree" observable="false">
(-)a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/i18n/guidancerStrings.properties (+1 lines)
Lines 949-954 TestErrorEvent.UnsupportedParameterValue=Parameter value "{0}" is not supported Link Here
949
TestErrorEvent.UnsupportedUI=Unsupported UI class\: "{0}"
949
TestErrorEvent.UnsupportedUI=Unsupported UI class\: "{0}"
950
TestErrorEvent.VerifyFailed=Check Failed
950
TestErrorEvent.VerifyFailed=Check Failed
951
TestErrorEvent.WindowActivationFailed=Window activation failed.
951
TestErrorEvent.WindowActivationFailed=Window activation failed.
952
TestErrorEvent.CheckboxNotFound=Checkbox not found
952
TestExecutionContributor.AUTNotFound=AUT not found.\nPlease check the AUT configuration.
953
TestExecutionContributor.AUTNotFound=AUT not found.\nPlease check the AUT configuration.
953
TestExecutionContributor.AUTStartedRecording=Observation mode
954
TestExecutionContributor.AUTStartedRecording=Observation mode
954
TestExecutionContributor.AUTStartedRecordingCheckMode=Observation mode (Check Mode)
955
TestExecutionContributor.AUTStartedRecordingCheckMode=Observation mode (Check Mode)
(-)a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/objects/event/TestErrorEvent.java (-2 / +8 lines)
Lines 22-28 import java.util.Map; Link Here
22
 * @author BREDEX GmbH
22
 * @author BREDEX GmbH
23
 * @created 04.04.2005
23
 * @created 04.04.2005
24
 */
24
 */
25
public class TestErrorEvent {
25
public class TestErrorEvent {
26
    
27
    /**
28
     * Checkbox has not been found
29
     */
30
    public static final String CHECKBOX_NOT_FOUND =
31
        "TestErrorEvent.CheckboxNotFound"; //$NON-NLS-1$
32
26
    /**
33
    /**
27
     * unsupported keyboard layout.
34
     * unsupported keyboard layout.
28
     */
35
     */
29
- 

Return to bug 414672