hp.add( new SmallLabel( Constants.INSTANCE.Attributes() ) );
attributeConfigWidget.add( hp );
}
for ( AttributeCol52 atc : guidedDecisionTable.getAttributeCols() ) {
final AttributeCol52 at = atc;
HorizontalPanel hp = new HorizontalPanel();
hp.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
hp.add( new HTML( " " ) );
if ( !isReadOnly ) {
hp.add( removeAttr( at ) );
}
final SmallLabel label = makeColumnLabel( atc );
hp.add( label );
final TextBox defaultValue = new TextBox();
final DTCellValue52 dcv = at.getDefaultValue();
defaultValue.setStyleName( "form-field" );
defaultValue.setText( (dcv == null ? "" : dcv.getStringValue()) );
defaultValue.setEnabled( !isReadOnly );
defaultValue.addChangeHandler( new ChangeHandler() {
public void onChange(ChangeEvent event) {
at.setDefaultValue( new DTCellValue52( defaultValue.getText() ) );
}
} );
if ( at.getAttribute().equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
hp.add( new HTML( " " ) );
final CheckBox useRowNumber = new CheckBox( Constants.INSTANCE.UseRowNumber() );
useRowNumber.setStyleName( "form-field" );
useRowNumber.setValue( at.isUseRowNumber() );
useRowNumber.setEnabled( !isReadOnly );
hp.add( useRowNumber );
hp.add( new SmallLabel( "(" ) );
final CheckBox reverseOrder = new CheckBox( Constants.INSTANCE.ReverseOrder() );
reverseOrder.setStyleName( "form-field" );
reverseOrder.setValue( at.isReverseOrder() );
reverseOrder.setEnabled( at.isUseRowNumber() && !isReadOnly );
useRowNumber.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent sender) {
at.setUseRowNumber( useRowNumber.getValue() );
reverseOrder.setEnabled( useRowNumber.getValue() );
dtable.updateSystemControlledColumnValues();
}
} );
reverseOrder.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent sender) {
at.setReverseOrder( reverseOrder.getValue() );
dtable.updateSystemControlledColumnValues();
}
} );
hp.add( reverseOrder );
hp.add( new SmallLabel( ")" ) );
}
hp.add( new HTML( " " ) );
hp.add( new SmallLabel( Constants.INSTANCE.DefaultValue() ) );
hp.add( defaultValue );
final CheckBox hide = new CheckBox( Constants.INSTANCE.HideThisColumn() );
hide.setStyleName( "form-field" );
hide.setValue( at.isHideColumn() );
hide.addClickHandler( new ClickHandler() {
public void onClick(ClickEvent sender) {
at.setHideColumn( hide.getValue() );
dtable.setColumnVisibility( at,
!at.isHideColumn() );
setColumnLabelStyleWhenHidden( label,
hide.getValue() );
}
} );
hp.add( new HTML( " " ) );