Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Dev/src/org/litesoft/GWT/client/dev/ui/testplan/TestPlanActionClickTableCell.java

Diff revisions: vs.
  @@ -1,72 +1,72 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.client.dev.ui.testplan;
3 -
4 - import org.litesoft.GWT.client.*;
5 - import org.litesoft.GWT.client.ui.inspection.*;
6 - import org.litesoft.GWT.client.widgets.datatables.*;
7 - import org.litesoft.testplan.*;
8 -
9 - import com.google.gwt.user.client.ui.*;
10 -
11 - public class TestPlanActionClickTableCell implements TestPlanAction
12 - {
13 - private static final long serialVersionUID = 1L;
14 -
15 - public static final String FORM = "ClickTableCell";
16 -
17 - private /* final */ Integer mNth;
18 - private /* final */ int mRow;
19 - private /* final */ int mCol;
20 - private /* final */ KeyboardKeyModifier mKeyboardKeyModifier;
21 -
22 - @SuppressWarnings({"deprecation", "UnusedDeclaration"}) @Deprecated /** for Serialization */
23 - protected TestPlanActionClickTableCell()
24 - {
25 - }
26 -
27 - public TestPlanActionClickTableCell( Integer pNth, int pRow, int pCol, KeyboardKeyModifier pKeyboardKeyModifier )
28 - {
29 - mNth = pNth;
30 - mRow = pRow;
31 - mCol = pCol;
32 - mKeyboardKeyModifier = KeyboardKeyModifier.deNull( pKeyboardKeyModifier );
33 - }
34 -
35 - protected WidgetSelector createWidgetSelector()
36 - {
37 - return new NthWidgetSelector(mNth)
38 - {
39 - public boolean isAcceptable( Widget pWidget )
40 - {
41 - return foundNth(pWidget instanceof Table);
42 - }
43 - };
44 - }
45 -
46 - public boolean execute( Object pClickHandlerSharedObject )
47 - {
48 - Table<?> zTable = WidgetFinder.findRequired( this, createWidgetSelector() );
49 - if ( zTable != null )
50 - {
51 - zTable.simulateUserClickDataGrid( mRow, mCol, mKeyboardKeyModifier );
52 - }
53 - return true;
54 - }
55 -
56 - @Override
57 - public String toString()
58 - {
59 - StringBuilder sb = new StringBuilder();
60 - sb.append( FORM );
61 - if ( mNth != null )
62 - {
63 - sb.append( '[' ).append( mNth ).append( ']' );
64 - }
65 - if ( !KeyboardKeyModifier.None.equals( mKeyboardKeyModifier ) )
66 - {
67 - sb.append( ' ' ).append( mKeyboardKeyModifier );
68 - }
69 - sb.append( " /w " ).append( "Cell: " ).append( mRow ).append( "," ).append( mCol );
70 - return sb.toString();
71 - }
72 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.client.dev.ui.testplan;
3 +
4 + import org.litesoft.GWT.client.*;
5 + import org.litesoft.GWT.client.ui.inspection.*;
6 + import org.litesoft.GWT.client.widgets.datatables.*;
7 + import org.litesoft.testplan.*;
8 +
9 + import com.google.gwt.user.client.ui.*;
10 +
11 + public class TestPlanActionClickTableCell implements TestPlanAction
12 + {
13 + private static final long serialVersionUID = 1L;
14 +
15 + public static final String FORM = "ClickTableCell";
16 +
17 + private /* final */ Integer mNth;
18 + private /* final */ int mRow;
19 + private /* final */ int mCol;
20 + private /* final */ KeyboardKeyModifier mKeyboardKeyModifier;
21 +
22 + @SuppressWarnings({"deprecation", "UnusedDeclaration"}) @Deprecated /** for Serialization */
23 + protected TestPlanActionClickTableCell()
24 + {
25 + }
26 +
27 + public TestPlanActionClickTableCell( Integer pNth, int pRow, int pCol, KeyboardKeyModifier pKeyboardKeyModifier )
28 + {
29 + mNth = pNth;
30 + mRow = pRow;
31 + mCol = pCol;
32 + mKeyboardKeyModifier = KeyboardKeyModifier.deNull( pKeyboardKeyModifier );
33 + }
34 +
35 + protected WidgetSelector createWidgetSelector()
36 + {
37 + return new NthWidgetSelector(mNth)
38 + {
39 + public boolean isAcceptable( Widget pWidget )
40 + {
41 + return foundNth(pWidget instanceof Table);
42 + }
43 + };
44 + }
45 +
46 + public boolean execute( Object pClickHandlerSharedObject )
47 + {
48 + Table<?> zTable = WidgetFinder.findRequired( this, createWidgetSelector() );
49 + if ( zTable != null )
50 + {
51 + zTable.simulateUserClickDataGrid( mRow, mCol, mKeyboardKeyModifier );
52 + }
53 + return true;
54 + }
55 +
56 + @Override
57 + public String toString()
58 + {
59 + StringBuilder sb = new StringBuilder();
60 + sb.append( FORM );
61 + if ( mNth != null )
62 + {
63 + sb.append( '[' ).append( mNth ).append( ']' );
64 + }
65 + if ( !KeyboardKeyModifier.None.equals( mKeyboardKeyModifier ) )
66 + {
67 + sb.append( ' ' ).append( mKeyboardKeyModifier );
68 + }
69 + sb.append( " /w " ).append( "Cell: " ).append( mRow ).append( "," ).append( mCol );
70 + return sb.toString();
71 + }
72 + }