}
ChangeListener cl = null;
if ( editing ) {
cl = new ChangeListener () {
public void onChange(Widget sender) {
formChanged();
}
};
CellPanel buttons = createButtons();
panel.getFlexCellFormatter().setColSpan(row, 0, 2);
panel.setWidget(row, 0, buttons);
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
}
AttrDef[] attrDefs = attrGroup.getAttrDefs();
for ( AttrDef attr : attrDefs ) {
if ( attr.isInternal() ) {
continue;
}
Widget widget;
// TODO: need to handle dynamic refresh of options? (Main.refreshOptions)
final List<Option> options = attr.getOptions();
final String optionsVocabulary = attr.getOptionsVocabulary();
// not listBoxes if we are just viewing
// Bofore, the following section was conditioned by:
// if ( editing && options.size() > 0 ) {
// and now by:
if ( editing && (optionsVocabulary != null || options.size() > 0) ) {
if ( Orr.getMetadataBaseInfo().getResourceTypeUri().equals(attr.getUri()) ) {
// the special case for the "resourceType"
// #183: Don't ask user whether the submitted ontology is a mapping
boolean includeIsMapCheck = false;
widget = resourceTypeWidget = new ResourceTypeWidget(attr, editing, includeIsMapCheck,
new ChangeListener () {
public void onChange(Widget sender) {
formChanged();
}
}
);