|
@@ -1,81 +1,81 @@ |
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.ui.inspection.*; |
5 |
|
- |
import org.litesoft.GWT.forms.client.components.nonpublic.*; |
6 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
7 |
|
- |
import org.litesoft.testplan.*; |
8 |
|
- |
|
9 |
|
- |
public abstract class AbstractTestPlanActionInputForm implements TestPlanAction |
10 |
|
- |
{ |
11 |
|
- |
private /* final */ String mLabel, mTooltip, mInputText; |
12 |
|
- |
private /* final */ Integer mNth; |
13 |
|
- |
|
14 |
|
- |
@SuppressWarnings("deprecation") @Deprecated /** for Serialization */ |
15 |
|
- |
protected AbstractTestPlanActionInputForm() |
16 |
|
- |
{ |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public AbstractTestPlanActionInputForm( String pLabel, String pTooltip, Integer pNth, String pInputText ) |
20 |
|
- |
{ |
21 |
|
- |
mLabel = pLabel; |
22 |
|
- |
mTooltip = pTooltip; |
23 |
|
- |
mNth = pNth; |
24 |
|
- |
mInputText = pInputText; |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
@Override |
28 |
|
- |
public String toString() |
29 |
|
- |
{ |
30 |
|
- |
StringBuilder sb = new StringBuilder(); |
31 |
|
- |
sb.append( form() ); |
32 |
|
- |
if ( mNth != null ) |
33 |
|
- |
{ |
34 |
|
- |
sb.append( '[' ).append( mNth ).append( ']' ); |
35 |
|
- |
} |
36 |
|
- |
sb.append( " /w " ); |
37 |
|
- |
if ( mLabel != null ) |
38 |
|
- |
{ |
39 |
|
- |
sb.append( "Label: " ).append( mLabel ); |
40 |
|
- |
} |
41 |
|
- |
else if ( mTooltip != null ) |
42 |
|
- |
{ |
43 |
|
- |
sb.append( "Tooltip: " ).append( mTooltip ); |
44 |
|
- |
} |
45 |
|
- |
return sb.toString(); |
46 |
|
- |
} |
47 |
|
- |
|
48 |
|
- |
public String getLabel() |
49 |
|
- |
{ |
50 |
|
- |
return mLabel; |
51 |
|
- |
} |
52 |
|
- |
|
53 |
|
- |
public String getTooltip() |
54 |
|
- |
{ |
55 |
|
- |
return mTooltip; |
56 |
|
- |
} |
57 |
|
- |
|
58 |
|
- |
public Integer getNth() |
59 |
|
- |
{ |
60 |
|
- |
return mNth; |
61 |
|
- |
} |
62 |
|
- |
|
63 |
|
- |
public String getInputText() |
64 |
|
- |
{ |
65 |
|
- |
return mInputText; |
66 |
|
- |
} |
67 |
|
- |
|
68 |
|
- |
abstract public String form(); |
69 |
|
- |
|
70 |
|
- |
public final boolean execute( Object pClickHandlerSharedObject ) |
71 |
|
- |
{ |
72 |
|
- |
AbstractFormElement zFormElement = WidgetFinder.findRequired( this, createWidgetSelector() ); |
73 |
|
- |
if ( zFormElement != null ) |
74 |
|
- |
{ |
75 |
|
- |
zFormElement.simulateUserTextEntry( Strings.deNull( getInputText() ) ); |
76 |
|
- |
} |
77 |
|
- |
return true; |
78 |
|
- |
} |
79 |
|
- |
|
80 |
|
- |
abstract protected WidgetSelector createWidgetSelector(); |
81 |
|
- |
} |
|
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.ui.inspection.*; |
|
5 |
+ |
import org.litesoft.GWT.forms.client.components.nonpublic.*; |
|
6 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
7 |
+ |
import org.litesoft.testplan.*; |
|
8 |
+ |
|
|
9 |
+ |
public abstract class AbstractTestPlanActionInputForm implements TestPlanAction |
|
10 |
+ |
{ |
|
11 |
+ |
private /* final */ String mLabel, mTooltip, mInputText; |
|
12 |
+ |
private /* final */ Integer mNth; |
|
13 |
+ |
|
|
14 |
+ |
@SuppressWarnings("deprecation") @Deprecated /** for Serialization */ |
|
15 |
+ |
protected AbstractTestPlanActionInputForm() |
|
16 |
+ |
{ |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public AbstractTestPlanActionInputForm( String pLabel, String pTooltip, Integer pNth, String pInputText ) |
|
20 |
+ |
{ |
|
21 |
+ |
mLabel = pLabel; |
|
22 |
+ |
mTooltip = pTooltip; |
|
23 |
+ |
mNth = pNth; |
|
24 |
+ |
mInputText = pInputText; |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
@Override |
|
28 |
+ |
public String toString() |
|
29 |
+ |
{ |
|
30 |
+ |
StringBuilder sb = new StringBuilder(); |
|
31 |
+ |
sb.append( form() ); |
|
32 |
+ |
if ( mNth != null ) |
|
33 |
+ |
{ |
|
34 |
+ |
sb.append( '[' ).append( mNth ).append( ']' ); |
|
35 |
+ |
} |
|
36 |
+ |
sb.append( " /w " ); |
|
37 |
+ |
if ( mLabel != null ) |
|
38 |
+ |
{ |
|
39 |
+ |
sb.append( "Label: " ).append( mLabel ); |
|
40 |
+ |
} |
|
41 |
+ |
else if ( mTooltip != null ) |
|
42 |
+ |
{ |
|
43 |
+ |
sb.append( "Tooltip: " ).append( mTooltip ); |
|
44 |
+ |
} |
|
45 |
+ |
return sb.toString(); |
|
46 |
+ |
} |
|
47 |
+ |
|
|
48 |
+ |
public String getLabel() |
|
49 |
+ |
{ |
|
50 |
+ |
return mLabel; |
|
51 |
+ |
} |
|
52 |
+ |
|
|
53 |
+ |
public String getTooltip() |
|
54 |
+ |
{ |
|
55 |
+ |
return mTooltip; |
|
56 |
+ |
} |
|
57 |
+ |
|
|
58 |
+ |
public Integer getNth() |
|
59 |
+ |
{ |
|
60 |
+ |
return mNth; |
|
61 |
+ |
} |
|
62 |
+ |
|
|
63 |
+ |
public String getInputText() |
|
64 |
+ |
{ |
|
65 |
+ |
return mInputText; |
|
66 |
+ |
} |
|
67 |
+ |
|
|
68 |
+ |
abstract public String form(); |
|
69 |
+ |
|
|
70 |
+ |
public final boolean execute( Object pClickHandlerSharedObject ) |
|
71 |
+ |
{ |
|
72 |
+ |
AbstractFormElement zFormElement = WidgetFinder.findRequired( this, createWidgetSelector() ); |
|
73 |
+ |
if ( zFormElement != null ) |
|
74 |
+ |
{ |
|
75 |
+ |
zFormElement.simulateUserTextEntry( ConstrainTo.notNull( getInputText() ) ); |
|
76 |
+ |
} |
|
77 |
+ |
return true; |
|
78 |
+ |
} |
|
79 |
+ |
|
|
80 |
+ |
abstract protected WidgetSelector createWidgetSelector(); |
|
81 |
+ |
} |