* @param name
* @param i
* @return
*/
public static FormCheckbox getBooleanFlag(final String name, final RubyObject holder, final int index, final int flag) {
final JavaTable table = new JavaTable(holder);
return (FormCheckbox) new FormCheckbox(name, (table.get(index, 0, 0) & flag) == flag).addChangeListener(new FormElementChangeListener() {
@Override
public void stateChanged(FormElement form) {
if (Boolean.parseBoolean(form.getContentAsString())) {
table.set(index, 0, 0, table.get(index, 0, 0) | flag);
} else {
table.set(index, 0, 0, table.get(index, 0, 0));
}
}
});
}