outer.setStyleName( "modeller-fact-pattern-Widget" ); //NON-NLS
this.oracle = oracle;
this.scenario = sc;
this.executionTrace = executionTrace;
HorizontalPanel ab = new HorizontalPanel();
ClickableLabel label = null;
final ClickHandler handler = new ClickHandler() {
public void onClick( ClickEvent w ) {
final ListBox b = new ListBox();
VerifyFactWidget.this.oracle.getFieldCompletions( type,
new Callback<ModelField[]>() {
@Override
public void callback( final ModelField[] fields ) {
for ( int i = 0; i < fields.length; i++ ) {
b.addItem( fields[ i ].getName() );
}
}
} );
final FormStylePopup pop = new FormStylePopup( TestScenarioAltedImages.INSTANCE.RuleAsset(),
TestScenarioConstants.INSTANCE.ChooseAFieldToAdd() );
pop.addRow( b );
pop.add( new ModalFooterOKCancelButtons( new Command() {
@Override
public void execute() {
String f = b.getItemText( b.getSelectedIndex() );
vf.getFieldValues().add( new VerifyField( f,
"",
"==" ) );
FlexTable data = render( vf );
outer.setWidget( 1,
0,
data );
pop.hide();
}
}, new Command() {
@Override
public void execute() {
pop.hide();
}
}
) );
pop.show();
}
};
if ( !vf.anonymous ) {
type = (String) sc.getVariableTypes().get( vf.getName() );
label = new ClickableLabel( TestScenarioConstants.INSTANCE.scenarioFactTypeHasValues( type,
vf.getName() ),
handler );
} else {
type = vf.getName();
label = new ClickableLabel( TestScenarioConstants.INSTANCE.AFactOfType0HasValues( vf.getName() ),
handler );
}
ab.add( label );
this.showResults = showResults;