private Widget removeCondition( final ConditionCol52 c ) {
Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn() );
if ( c instanceof LimitedEntryBRLConditionColumn ) {
return new ImageButton( image,
GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
if ( !canConditionBeDeleted( (LimitedEntryBRLConditionColumn) c ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );
return;
}
String cm = GuidedDecisionTableConstants.INSTANCE.DeleteConditionColumnWarning0( c.getHeader() );
if ( Window.confirm( cm ) ) {
dtable.deleteColumn( (LimitedEntryBRLConditionColumn) c );
refreshConditionsWidget();
}
}
} );
} else if ( c instanceof BRLConditionColumn ) {
return new ImageButton( image,
GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
if ( !canConditionBeDeleted( (BRLConditionColumn) c ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );
return;
}
String cm = GuidedDecisionTableConstants.INSTANCE.DeleteConditionColumnWarning0( c.getHeader() );
if ( Window.confirm( cm ) ) {
dtable.deleteColumn( (BRLConditionColumn) c );
refreshConditionsWidget();
}
}
} );
}
return new ImageButton( image,
GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
new ClickHandler() {
public void onClick( ClickEvent w ) {
if ( !canConditionBeDeleted( c ) ) {
Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );