if ( showResults && v.getSuccessResult() != null ) {
if ( !v.getSuccessResult().booleanValue() ) {
data.setWidget( i,
0,
new Image( images.warning() ) );
data.setWidget( i,
4,
new HTML( constants.ActualResult(v.getActualResult().toString()) ) );
data.getCellFormatter().addStyleName( i,
4,
"testErrorValue" ); //NON-NLS
} else {
data.setWidget( i,
0,
new Image( images.testPassed() ) );
}
}
data.setWidget( i,
1,
new SmallLabel( v.getRuleName() + ":" ) );
data.getFlexCellFormatter().setAlignment( i,
1,
HasHorizontalAlignment.ALIGN_RIGHT,
HasVerticalAlignment.ALIGN_MIDDLE );
final ListBox b = new ListBox();
b.addItem( constants.firedAtLeastOnce(),
"y" );
b.addItem( constants.didNotFire(),
"n" );
b.addItem( constants.firedThisManyTimes(),
"e" );
final TextBox num = new TextBox();
num.setVisibleLength( 5 );
if ( v.getExpectedFire() != null ) {
b.setSelectedIndex( (v.getExpectedFire().booleanValue()) ? 0 : 1 );
num.setVisible( false );
} else {
b.setSelectedIndex( 2 );
String xc = (v.getExpectedCount() != null) ? "" + v.getExpectedCount().intValue() : "0";
num.setText( xc );
}
b.addChangeHandler( new ChangeHandler() {
public void onChange(ChangeEvent event) {
String s = b.getValue( b.getSelectedIndex() );
if ( s.equals( "y" ) || s.equals( "n" ) ) {
num.setVisible( false );
v.setExpectedFire( (s.equals( "y" )) ? Boolean.TRUE : Boolean.FALSE );
v.setExpectedCount( null );
} else {
num.setVisible( true );
v.setExpectedFire( null );
num.setText( "1" );
v.setExpectedCount( new Integer( 1 ) );
}
}
} );
b.addItem( constants.ChooseDotDotDot() );
num.addChangeHandler( new ChangeHandler() {
public void onChange(ChangeEvent event) {
v.setExpectedCount( new Integer( num.getText() ) );
}
} );
HorizontalPanel h = new HorizontalPanel();
h.add( b );
h.add( num );
data.setWidget( i,
2,
h );
Image del = new ImageButton( images.deleteItemSmall(),
constants.RemoveThisRuleExpectation(),
new ClickHandler() {
public void onClick(ClickEvent w) {
if ( Window.confirm( constants.AreYouSureYouWantToRemoveThisRuleExpectation() ) ) {
rfl.remove( v );