use of com.google.gwt.user.client.ui.CheckBox in project opentsdb by OpenTSDB.
the class MetricForm method addTag.
private void addTag(final String default_tagname, final String default_value, final boolean is_groupby) {
final int row = tagtable.getRowCount();
final ValidatedTextBox tagname = new ValidatedTextBox();
final SuggestBox suggesttagk = RemoteOracle.newSuggestBox("tagk", tagname);
final ValidatedTextBox tagvalue = new ValidatedTextBox();
final SuggestBox suggesttagv = RemoteOracle.newSuggestBox("tagv", tagvalue);
final CheckBox groupby = new CheckBox();
groupby.setValue(is_groupby);
groupby.setTitle("Group by");
groupby.addClickHandler(events_handler);
tagname.setValidationRegexp(TSDB_ID_RE);
tagvalue.setValidationRegexp(TSDB_TAGVALUE_RE);
tagname.setWidth("100%");
tagvalue.setWidth("100%");
tagname.addBlurHandler(recompact_tagtable);
tagname.addBlurHandler(events_handler);
tagname.addKeyPressHandler(events_handler);
tagvalue.addBlurHandler(recompact_tagtable);
tagvalue.addBlurHandler(events_handler);
tagvalue.addKeyPressHandler(events_handler);
tagtable.setWidget(row, 1, suggesttagk);
tagtable.setWidget(row, 2, suggesttagv);
tagtable.setWidget(row, 3, groupby);
if (row > 2) {
final Button remove = new Button("x");
remove.addClickHandler(removetag);
tagtable.setWidget(row - 1, 0, remove);
}
if (default_tagname != null) {
tagname.setText(default_tagname);
if (default_value == null) {
tagvalue.setFocus(true);
}
}
if (default_value != null) {
tagvalue.setText(default_value);
}
}
use of com.google.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class RSConnectDeploy method setPrimaryFile.
private void setPrimaryFile(String path) {
if (fileChecks_ == null)
return;
for (int i = 0; i < fileChecks_.size(); i++) {
CheckBox fileCheck = fileChecks_.get(i);
if (fileCheck.getText().equals(path)) {
// don't allow the user to unselect the primary file
fileCheck.setEnabled(false);
// make this bold and move it to the top
fileCheck.getElement().getStyle().setFontWeight(FontWeight.BOLD);
fileListPanel_.remove(fileCheck);
fileListPanel_.insert(fileCheck, 0);
}
}
}
use of com.google.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class RSConnectDeploy method checkUncheckAll.
private void checkUncheckAll() {
allChecked_ = !allChecked_;
for (CheckBox box : fileChecks_) {
// don't toggle state for disabled boxes, or common Shiny .R filenames
String file = box.getText().toLowerCase();
if (box.isEnabled() && file != "ui.r" && file != "server.r" && file != "app.r") {
box.setValue(allChecked_);
}
}
checkUncheckAllButton_.setText(allChecked_ ? "Uncheck All" : "Check All");
}
use of com.google.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class RSConnectDeploy method addFile.
private void addFile(String path, boolean checked) {
CheckBox fileCheck = new CheckBox(path);
fileCheck.setValue(checked);
fileListPanel_.add(fileCheck);
fileChecks_.add(fileCheck);
}
use of com.google.gwt.user.client.ui.CheckBox in project rstudio by rstudio.
the class UnsavedChangesDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
// create cell table
targetsCellTable_ = new CellTable<UnsavedChangesTarget>(15, UnsavedChangesCellTableResources.INSTANCE, KEY_PROVIDER);
selectionModel_ = new MultiSelectionModel<UnsavedChangesTarget>(KEY_PROVIDER);
targetsCellTable_.setSelectionModel(selectionModel_, DefaultSelectionEventManager.<UnsavedChangesTarget>createCheckboxManager());
targetsCellTable_.setWidth("100%", true);
// add columns
addSelectionColumn();
addIconColumn();
addNameAndPathColumn();
// hook-up data provider
dataProvider_ = new ListDataProvider<UnsavedChangesTarget>();
dataProvider_.setList(targets_);
dataProvider_.addDataDisplay(targetsCellTable_);
targetsCellTable_.setPageSize(targets_.size());
// select all by default
for (UnsavedChangesTarget editingTarget : dataProvider_.getList()) selectionModel_.setSelected(editingTarget, true);
// enclose cell table in scroll panel
ScrollPanel scrollPanel = new ScrollPanel();
scrollPanel.setStylePrimaryName(RESOURCES.styles().targetScrollPanel());
scrollPanel.setWidget(targetsCellTable_);
if (dataProvider_.getList().size() > 4)
scrollPanel.setHeight("280px");
// always save check box (may not be shown)
chkAlwaysSave_ = new CheckBox(alwaysSaveOption_);
// main widget
VerticalPanel panel = new VerticalPanel();
Label captionLabel = new Label("The following files have unsaved changes:");
captionLabel.setStylePrimaryName(RESOURCES.styles().captionLabel());
panel.add(captionLabel);
panel.add(scrollPanel);
if (!StringUtil.isNullOrEmpty(alwaysSaveOption_)) {
panel.add(chkAlwaysSave_);
panel.setCellHeight(chkAlwaysSave_, "30px");
panel.setCellVerticalAlignment(chkAlwaysSave_, HasVerticalAlignment.ALIGN_MIDDLE);
}
return panel;
}
Aggregations