use of com.google.gwt.user.client.ui.CheckBox in project gerrit by GerritCodeReview.
the class CreateProjectScreen method addCreateProjectPanel.
private void addCreateProjectPanel() {
final VerticalPanel fp = new VerticalPanel();
fp.setStyleName(Gerrit.RESOURCES.css().createProjectPanel());
initCreateButton();
initCreateTxt();
initParentBox();
addGrid(fp);
emptyCommit = new CheckBox(AdminConstants.I.checkBoxEmptyCommit());
permissionsOnly = new CheckBox(AdminConstants.I.checkBoxPermissionsOnly());
fp.add(emptyCommit);
fp.add(permissionsOnly);
fp.add(create);
VerticalPanel vp = new VerticalPanel();
vp.add(fp);
initSuggestedParents();
vp.add(suggestedParentsTab);
add(vp);
}
use of com.google.gwt.user.client.ui.CheckBox in project gerrit by GerritCodeReview.
the class MyPreferencesScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
showSiteHeader = new CheckBox(Util.C.showSiteHeader());
useFlashClipboard = new CheckBox(Util.C.useFlashClipboard());
maximumPageSize = new ListBox();
for (final int v : PAGESIZE_CHOICES) {
maximumPageSize.addItem(Util.M.rowsPerPage(v), String.valueOf(v));
}
reviewCategoryStrategy = new ListBox();
reviewCategoryStrategy.addItem(Util.C.messageShowInReviewCategoryNone(), GeneralPreferencesInfo.ReviewCategoryStrategy.NONE.name());
reviewCategoryStrategy.addItem(Util.C.messageShowInReviewCategoryName(), GeneralPreferencesInfo.ReviewCategoryStrategy.NAME.name());
reviewCategoryStrategy.addItem(Util.C.messageShowInReviewCategoryEmail(), GeneralPreferencesInfo.ReviewCategoryStrategy.EMAIL.name());
reviewCategoryStrategy.addItem(Util.C.messageShowInReviewCategoryUsername(), GeneralPreferencesInfo.ReviewCategoryStrategy.USERNAME.name());
reviewCategoryStrategy.addItem(Util.C.messageShowInReviewCategoryAbbrev(), GeneralPreferencesInfo.ReviewCategoryStrategy.ABBREV.name());
emailStrategy = new ListBox();
emailStrategy.addItem(Util.C.messageCCMeOnMyComments(), GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS.name());
emailStrategy.addItem(Util.C.messageEnabled(), GeneralPreferencesInfo.EmailStrategy.ENABLED.name());
emailStrategy.addItem(Util.C.messageDisabled(), GeneralPreferencesInfo.EmailStrategy.DISABLED.name());
emailFormat = new ListBox();
emailFormat.addItem(Util.C.messagePlaintextOnly(), GeneralPreferencesInfo.EmailFormat.PLAINTEXT.name());
emailFormat.addItem(Util.C.messageHtmlPlaintext(), GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT.name());
defaultBaseForMerges = new ListBox();
defaultBaseForMerges.addItem(Util.C.autoMerge(), GeneralPreferencesInfo.DefaultBase.AUTO_MERGE.name());
defaultBaseForMerges.addItem(Util.C.firstParent(), GeneralPreferencesInfo.DefaultBase.FIRST_PARENT.name());
diffView = new ListBox();
diffView.addItem(com.google.gerrit.client.changes.Util.C.sideBySide(), GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE.name());
diffView.addItem(com.google.gerrit.client.changes.Util.C.unifiedDiff(), GeneralPreferencesInfo.DiffView.UNIFIED_DIFF.name());
Date now = new Date();
dateFormat = new ListBox();
for (GeneralPreferencesInfo.DateFormat fmt : GeneralPreferencesInfo.DateFormat.values()) {
StringBuilder r = new StringBuilder();
r.append(DateTimeFormat.getFormat(fmt.getShortFormat()).format(now));
r.append(" ; ");
r.append(DateTimeFormat.getFormat(fmt.getLongFormat()).format(now));
dateFormat.addItem(r.toString(), fmt.name());
}
timeFormat = new ListBox();
for (GeneralPreferencesInfo.TimeFormat fmt : GeneralPreferencesInfo.TimeFormat.values()) {
StringBuilder r = new StringBuilder();
r.append(DateTimeFormat.getFormat(fmt.getFormat()).format(now));
timeFormat.addItem(r.toString(), fmt.name());
}
FlowPanel dateTimePanel = new FlowPanel();
final int labelIdx;
final int fieldIdx;
if (LocaleInfo.getCurrentLocale().isRTL()) {
labelIdx = 1;
fieldIdx = 0;
dateTimePanel.add(timeFormat);
dateTimePanel.add(dateFormat);
} else {
labelIdx = 0;
fieldIdx = 1;
dateTimePanel.add(dateFormat);
dateTimePanel.add(timeFormat);
}
highlightAssigneeInChangeTable = new CheckBox(Util.C.highlightAssigneeInChangeTable());
relativeDateInChangeTable = new CheckBox(Util.C.showRelativeDateInChangeTable());
sizeBarInChangeTable = new CheckBox(Util.C.showSizeBarInChangeTable());
legacycidInChangeTable = new CheckBox(Util.C.showLegacycidInChangeTable());
muteCommonPathPrefixes = new CheckBox(Util.C.muteCommonPathPrefixes());
signedOffBy = new CheckBox(Util.C.signedOffBy());
publishCommentsOnPush = new CheckBox(Util.C.publishCommentsOnPush());
boolean flashClippy = !UserAgent.hasJavaScriptClipboard() && UserAgent.Flash.isInstalled();
final Grid formGrid = new Grid(15 + (flashClippy ? 1 : 0), 2);
int row = 0;
formGrid.setText(row, labelIdx, Util.C.reviewCategoryLabel());
formGrid.setWidget(row, fieldIdx, reviewCategoryStrategy);
row++;
formGrid.setText(row, labelIdx, Util.C.maximumPageSizeFieldLabel());
formGrid.setWidget(row, fieldIdx, maximumPageSize);
row++;
formGrid.setText(row, labelIdx, Util.C.dateFormatLabel());
formGrid.setWidget(row, fieldIdx, dateTimePanel);
row++;
formGrid.setText(row, labelIdx, Util.C.emailFieldLabel());
formGrid.setWidget(row, fieldIdx, emailStrategy);
row++;
formGrid.setText(row, labelIdx, Util.C.emailFormatFieldLabel());
formGrid.setWidget(row, fieldIdx, emailFormat);
row++;
formGrid.setText(row, labelIdx, Util.C.defaultBaseForMerges());
formGrid.setWidget(row, fieldIdx, defaultBaseForMerges);
row++;
formGrid.setText(row, labelIdx, Util.C.diffViewLabel());
formGrid.setWidget(row, fieldIdx, diffView);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, showSiteHeader);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, highlightAssigneeInChangeTable);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, relativeDateInChangeTable);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, sizeBarInChangeTable);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, legacycidInChangeTable);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, muteCommonPathPrefixes);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, signedOffBy);
row++;
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, publishCommentsOnPush);
row++;
if (flashClippy) {
formGrid.setText(row, labelIdx, "");
formGrid.setWidget(row, fieldIdx, useFlashClipboard);
}
add(formGrid);
save = new Button(Util.C.buttonSaveChanges());
save.setEnabled(false);
save.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doSave();
}
});
myMenus = new MyMenuPanel(save);
add(myMenus);
add(save);
final OnEditEnabler e = new OnEditEnabler(save);
e.listenTo(showSiteHeader);
e.listenTo(useFlashClipboard);
e.listenTo(maximumPageSize);
e.listenTo(dateFormat);
e.listenTo(timeFormat);
e.listenTo(highlightAssigneeInChangeTable);
e.listenTo(relativeDateInChangeTable);
e.listenTo(sizeBarInChangeTable);
e.listenTo(legacycidInChangeTable);
e.listenTo(muteCommonPathPrefixes);
e.listenTo(signedOffBy);
e.listenTo(publishCommentsOnPush);
e.listenTo(diffView);
e.listenTo(reviewCategoryStrategy);
e.listenTo(emailStrategy);
e.listenTo(emailFormat);
e.listenTo(defaultBaseForMerges);
}
use of com.google.gwt.user.client.ui.CheckBox 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.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class ProjectTemplateWidget method checkBoxInput.
private ProjectTemplateWidgetItem checkBoxInput(final ProjectTemplateWidgetDescription description) {
final CheckBox widget = new CheckBox(description.getLabel());
// set default value
String defaultValue = description.getDefault();
if (!StringUtil.isNullOrEmpty(defaultValue))
widget.setValue(isTruthy(defaultValue));
return new ProjectTemplateWidgetItem(widget, new Collector() {
@Override
public void collectInput(JsObject receiver) {
boolean value = widget.getValue();
receiver.setBoolean(description.getParameter(), value);
}
});
}
use of com.google.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class ProjectPackratPreferencesPane method initialize.
@Override
protected void initialize(RProjectOptions options) {
Styles styles = RES.styles();
Label label = new Label("Packrat is a dependency management tool that makes your " + "R code more isolated, portable, and reproducible by " + "giving your project its own privately managed package " + "library.");
spaced(label);
add(label);
PackratContext context = options.getPackratContext();
RProjectPackratOptions packratOptions = options.getPackratOptions();
chkUsePackrat_ = new CheckBox("Use packrat with this project");
chkUsePackrat_.setValue(context.isPackified());
chkUsePackrat_.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
if (event.getValue())
verifyPrerequisites();
else
manageUI(false);
}
});
spaced(chkUsePackrat_);
add(chkUsePackrat_);
chkAutoSnapshot_ = new CheckBox("Automatically snapshot local changes");
chkAutoSnapshot_.setValue(packratOptions.getAutoSnapshot());
lessSpaced(chkAutoSnapshot_);
add(chkAutoSnapshot_);
String vcsName = session_.getSessionInfo().getVcsName();
chkVcsIgnoreLib_ = new CheckBox(vcsName + " ignore packrat library");
chkVcsIgnoreLib_.setValue(packratOptions.getVcsIgnoreLib());
lessSpaced(chkVcsIgnoreLib_);
add(chkVcsIgnoreLib_);
chkVcsIgnoreSrc_ = new CheckBox(vcsName + " ignore packrat sources");
chkVcsIgnoreSrc_.setValue(packratOptions.getVcsIgnoreSrc());
lessSpaced(chkVcsIgnoreSrc_);
add(chkVcsIgnoreSrc_);
chkUseCache_ = new CheckBox("Use global cache for installed packages");
chkUseCache_.setValue(packratOptions.getUseCache());
spaced(chkUseCache_);
add(chkUseCache_);
panelExternalPackages_ = new VerticalPanel();
panelExternalPackages_.add(new LabelWithHelp("External packages (comma separated):", "packrat_external_packages", false));
taExternalPackages_ = new FixedTextArea(3);
taExternalPackages_.addStyleName(styles.externalPackages());
taExternalPackages_.setText(StringUtil.join(Arrays.asList(JsUtil.toStringArray(packratOptions.getExternalPackages())), ", "));
taExternalPackages_.getElement().getStyle().setMarginBottom(8, Unit.PX);
panelExternalPackages_.add(taExternalPackages_);
add(panelExternalPackages_);
widgetLocalRepos_ = new LocalRepositoriesWidget();
String[] localRepos = JsUtil.toStringArray(packratOptions.getLocalRepos());
for (int i = 0; i < localRepos.length; ++i) {
widgetLocalRepos_.addItem(localRepos[i]);
}
add(widgetLocalRepos_);
manageUI(context.isPackified());
HelpLink helpLink = new HelpLink("Learn more about Packrat", "packrat", false);
helpLink.getElement().getStyle().setMarginTop(15, Unit.PX);
nudgeRight(helpLink);
add(helpLink);
}
Aggregations