use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class CreateGroupScreen method addCreateGroupPanel.
private void addCreateGroupPanel() {
VerticalPanel addPanel = new VerticalPanel();
addPanel.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
addPanel.add(new SmallHeading(AdminConstants.I.headingCreateGroup()));
addTxt = new NpTextBox() {
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
if (event.getTypeInt() == Event.ONPASTE) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (addTxt.getValue().trim().length() != 0) {
addNew.setEnabled(true);
}
}
});
}
}
};
addTxt.sinkEvents(Event.ONPASTE);
addTxt.setVisibleLength(60);
addTxt.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doCreateGroup();
}
}
});
addPanel.add(addTxt);
addNew = new Button(AdminConstants.I.buttonCreateGroup());
addNew.setEnabled(false);
addNew.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doCreateGroup();
}
});
addPanel.add(addNew);
add(addPanel);
new OnEditEnabler(addNew, addTxt);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class AccountGroupAuditLogScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
add(new SmallHeading(AdminConstants.I.headingAuditLog()));
auditEventTable = new AuditEventTable();
add(auditEventTable);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class AccountGroupInfoScreen method initGroupOptions.
private void initGroupOptions() {
final VerticalPanel groupOptionsPanel = new VerticalPanel();
final VerticalPanel vp = new VerticalPanel();
vp.setStyleName(Gerrit.RESOURCES.css().groupOptionsPanel());
vp.add(new SmallHeading(AdminConstants.I.headingGroupOptions()));
visibleToAllCheckBox = new CheckBox(AdminConstants.I.isVisibleToAll());
vp.add(visibleToAllCheckBox);
groupOptionsPanel.add(vp);
saveGroupOptions = new Button(AdminConstants.I.buttonSaveGroupOptions());
saveGroupOptions.setEnabled(false);
saveGroupOptions.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
GroupApi.setGroupOptions(getGroupUUID(), visibleToAllCheckBox.getValue(), new GerritCallback<VoidResult>() {
@Override
public void onSuccess(final VoidResult result) {
saveGroupOptions.setEnabled(false);
}
});
}
});
groupOptionsPanel.add(saveGroupOptions);
add(groupOptionsPanel);
final OnEditEnabler enabler = new OnEditEnabler(saveGroupOptions);
enabler.listenTo(visibleToAllCheckBox);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initAgreements.
private void initAgreements() {
grid.addHeader(new SmallHeading(AdminConstants.I.headingAgreements()));
contributorAgreements = newInheritedBooleanBox();
if (Gerrit.info().auth().useContributorAgreements()) {
saveEnabler.listenTo(contributorAgreements);
grid.add(AdminConstants.I.useContributorAgreements(), contributorAgreements);
}
signedOffBy = newInheritedBooleanBox();
saveEnabler.listenTo(signedOffBy);
grid.addHtml(AdminConstants.I.useSignedOffBy(), signedOffBy);
}
use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initPluginOptions.
private void initPluginOptions(ConfigInfo info) {
pluginOptionsPanel.clear();
pluginConfigWidgets = new HashMap<>();
for (String pluginName : info.pluginConfig().keySet()) {
Map<String, HasEnabled> widgetMap = new HashMap<>();
pluginConfigWidgets.put(pluginName, widgetMap);
LabeledWidgetsGrid g = new LabeledWidgetsGrid();
g.addHeader(new SmallHeading(AdminMessages.I.pluginProjectOptionsTitle(pluginName)));
pluginOptionsPanel.add(g);
NativeMap<ConfigParameterInfo> pluginConfig = info.pluginConfig(pluginName);
pluginConfig.copyKeysIntoChildren("name");
for (ConfigParameterInfo param : Natives.asList(pluginConfig.values())) {
HasEnabled w;
switch(param.type()) {
case "STRING":
case "INT":
case "LONG":
w = renderTextBox(g, param);
break;
case "BOOLEAN":
w = renderCheckBox(g, param);
break;
case "LIST":
w = renderListBox(g, param);
break;
case "ARRAY":
w = renderStringListPanel(g, param);
break;
default:
throw new UnsupportedOperationException("unsupported widget type");
}
if (param.editable()) {
widgetMap.put(param.name(), w);
} else {
w.setEnabled(false);
}
}
}
enableForm();
}
Aggregations