* $result = RoutingResult( NerOption.types contains "arzt" )
*
* @param sortedConst a sorted list of constraints to display.
* */
private void drawConstraints(List<FieldConstraint> sortedConst) {
final DirtyableFlexTable table = new DirtyableFlexTable();
layout.setWidget(1, 0, table);
List<FieldConstraint> parents = new ArrayList<FieldConstraint>();
for (int i = 0; i < sortedConst.size(); i++) {
int tabs = -1;
FieldConstraint current = sortedConst.get(i);
if (current instanceof SingleFieldConstraint) {
SingleFieldConstraint single = (SingleFieldConstraint) current;
FieldConstraint parent = single.parent;
for (int j = 0; j < parents.size(); j++) {
FieldConstraint storedParent = parents.get(j);
if (storedParent != null && storedParent.equals(parent)) {
tabs = j + 1;
for (int k = j + 1; k < parents.size(); k++) {
parents.remove(j + 1);
}
parents.add(current);
break;
}
}
if (tabs < 0) {
tabs = 0;
parents.add(current);
}
}
renderFieldConstraint(table, i, current, true, tabs);
//now the clear icon
final int currentRow = i;
Image clear = new ImageButton("images/delete_faded.gif");//NON-NLS
clear.setTitle(constants.RemoveThisWholeRestriction());
clear.addClickListener(new ClickListener() {
public void onClick(Widget w) {
if (Window.confirm(constants.RemoveThisItem())) {
setModified(true);
pattern.removeConstraint(currentRow);
getModeller().refreshWidget();
}
}
});
if (!this.readOnly) {
table.setWidget(currentRow, 5, clear);
}
}
}