use of com.google.gwt.user.client.ui.CheckBox in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method renderCheckBox.
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
CheckBox checkBox = new CheckBox(getDisplayName(param));
checkBox.setValue(Boolean.parseBoolean(param.value()));
HorizontalPanel p = new HorizontalPanel();
p.add(checkBox);
if (param.description() != null) {
Image infoImg = new Image(Gerrit.RESOURCES.info());
infoImg.setTitle(param.description());
p.add(infoImg);
}
if (param.warning() != null) {
Image warningImg = new Image(Gerrit.RESOURCES.warning());
warningImg.setTitle(param.warning());
p.add(warningImg);
}
g.add((String) null, p);
saveEnabler.listenTo(checkBox);
return checkBox;
}
use of com.google.gwt.user.client.ui.CheckBox in project gerrit by GerritCodeReview.
the class ReplyBox method renderCheckBox.
private void renderCheckBox(int row, LabelAndValues lv) {
ApprovalInfo self = Gerrit.isSignedIn() ? lv.info.forUser(Gerrit.getUserAccount().getId().get()) : null;
final String id = lv.info.name();
final CheckBox b = new CheckBox();
b.setText(id);
b.setEnabled(lv.permitted.contains((short) 1));
if (self != null && self.value() == 1) {
b.setValue(true);
}
b.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
in.label(id, event.getValue() ? (short) 1 : (short) 0);
}
});
b.setStyleName(style.label_name());
labelsTable.setWidget(row, 0, b);
CellFormatter fmt = labelsTable.getCellFormatter();
fmt.setStyleName(row, labelHelpColumn, style.label_help());
labelsTable.setText(row, labelHelpColumn, lv.info.valueText("+1"));
}
Aggregations