/** Wraps a RuleModellerWidget with an icon to delete the pattern */ private Widget wrapLHSWidget(final CompositeFactPattern model, int i, RuleModellerWidget w) { DirtyableHorizontalPane horiz = new DirtyableHorizontalPane(); final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall(); remove.setTitle( Constants.INSTANCE.RemoveThisENTIREConditionAndAllTheFieldConstraintsThatBelongToIt()); final int idx = i; remove.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (Window.confirm(Constants.INSTANCE.RemoveThisEntireConditionQ())) { if (pattern.removeFactPattern(idx)) { getModeller().refreshWidget(); } } } }); horiz.setWidth("100%"); w.setWidth("100%"); horiz.add(w); if (!(getModeller().lockLHS() || w.isReadOnly())) { horiz.add(remove); } return horiz; }