use of com.google.gwt.user.client.ui.ListBox in project cuba by cuba-platform.
the class SuggestPopup method createChoiceList.
protected void createChoiceList() {
choiceList = new ListBox();
choiceList.setStyleName("list");
choiceList.addKeyDownHandler(this);
choiceList.addDoubleClickHandler(this);
choiceList.addChangeHandler(this);
choiceList.setStylePrimaryName("aceeditor-suggestpopup-list");
setWidget(choiceList);
}
use of com.google.gwt.user.client.ui.ListBox in project che by eclipse.
the class ResolveViewImpl method addConflictingFile.
@Override
public void addConflictingFile(String filePath) {
Label filePathLabel = new Label(filePath);
filePathLabel.getElement().getStyle().setFloat(Float.LEFT);
filePathLabel.getElement().getStyle().setMarginRight(1, Unit.EM);
ListBox conflictResolutionActions = new ListBox();
for (ConflictResolutionAction action : conflictActions) {
conflictResolutionActions.addItem(action.getText());
}
filesResolutionActions.put(filePath, conflictResolutionActions);
Element resolutionDiv = DOM.createDiv();
resolutionDiv.getStyle().setMarginLeft(1, Unit.EM);
resolutionDiv.getStyle().setMarginRight(1, Unit.EM);
resolutionDiv.getStyle().setMarginBottom(1, Unit.EM);
resolutionDiv.getStyle().setTextAlign(TextAlign.RIGHT);
resolutionDiv.appendChild(filePathLabel.getElement());
resolutionDiv.appendChild(conflictResolutionActions.getElement());
mainPanel.getElement().appendChild(resolutionDiv);
}
use of com.google.gwt.user.client.ui.ListBox in project rstudio by rstudio.
the class ChooseEncodingDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
listBox_ = new ListBox();
listBox_.setMultipleSelect(true);
listBox_.setVisibleItemCount(15);
listBox_.setWidth("350px");
setEncodings(commonEncodings_, currentEncoding_);
CheckBox showAll = new CheckBox("Show all encodings");
showAll.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> e) {
if (e.getValue())
setEncodings(allEncodings_, currentEncoding_);
else
setEncodings(commonEncodings_, currentEncoding_);
}
});
setCheckBoxMargins(showAll, 8, 12);
VerticalPanel panel = new VerticalPanel();
panel.add(listBox_);
panel.add(showAll);
if (includeSaveAsDefault_) {
saveAsDefault_ = new CheckBox("Set as default encoding for " + "source files");
setCheckBoxMargins(showAll, 8, 0);
setCheckBoxMargins(saveAsDefault_, 3, 12);
panel.add(saveAsDefault_);
}
return panel;
}
use of com.google.gwt.user.client.ui.ListBox in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method renderListBox.
private ListBox renderListBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
if (param.permittedValues() == null) {
return null;
}
ListBox listBox = new ListBox();
if (param.inheritable()) {
listBox.addItem(AdminMessages.I.pluginProjectInheritedListValue(param.inheritedValue()));
if (param.configuredValue() == null) {
listBox.setSelectedIndex(0);
}
for (int i = 0; i < param.permittedValues().length(); i++) {
String pv = param.permittedValues().get(i);
listBox.addItem(pv);
if (pv.equals(param.configuredValue())) {
listBox.setSelectedIndex(i + 1);
}
}
} else {
for (int i = 0; i < param.permittedValues().length(); i++) {
String pv = param.permittedValues().get(i);
listBox.addItem(pv);
if (pv.equals(param.value())) {
listBox.setSelectedIndex(i);
}
}
}
if (param.editable()) {
saveEnabler.listenTo(listBox);
addWidget(g, listBox, param);
} else {
listBox.setEnabled(false);
if (param.inheritable() && listBox.getSelectedIndex() != 0) {
// the inherited value is not selected,
// since the listBox is disabled the inherited value cannot be
// seen and we have to display it explicitly
Label inheritedLabel = new Label(AdminMessages.I.pluginProjectInheritedValue(param.inheritedValue()));
inheritedLabel.setStyleName(Gerrit.RESOURCES.css().pluginProjectConfigInheritedValue());
HorizontalPanel p = new HorizontalPanel();
p.add(listBox);
p.add(inheritedLabel);
addWidget(g, p, param);
} else {
addWidget(g, listBox, param);
}
}
return listBox;
}
use of com.google.gwt.user.client.ui.ListBox in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initProjectOptions.
private void initProjectOptions() {
grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
state = new ListBox();
for (ProjectState stateValue : ProjectState.values()) {
state.addItem(Util.toLongString(stateValue), stateValue.name());
}
saveEnabler.listenTo(state);
grid.add(AdminConstants.I.headingProjectState(), state);
submitType = new ListBox();
for (final SubmitType type : SubmitType.values()) {
submitType.addItem(Util.toLongString(type), type.name());
}
submitType.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
setEnabledForUseContentMerge();
}
});
saveEnabler.listenTo(submitType);
grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
contentMerge = newInheritedBooleanBox();
saveEnabler.listenTo(contentMerge);
grid.add(AdminConstants.I.useContentMerge(), contentMerge);
newChangeForAllNotInTarget = newInheritedBooleanBox();
saveEnabler.listenTo(newChangeForAllNotInTarget);
grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
requireChangeID = newInheritedBooleanBox();
saveEnabler.listenTo(requireChangeID);
grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
if (Gerrit.info().receive().enableSignedPush()) {
enableSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(enableSignedPush);
grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
requireSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(requireSignedPush);
grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
}
rejectImplicitMerges = newInheritedBooleanBox();
saveEnabler.listenTo(rejectImplicitMerges);
grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
enableReviewerByEmail = newInheritedBooleanBox();
saveEnabler.listenTo(enableReviewerByEmail);
grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
maxObjectSizeLimit = new NpTextBox();
saveEnabler.listenTo(maxObjectSizeLimit);
effectiveMaxObjectSizeLimit = new Label();
effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
HorizontalPanel p = new HorizontalPanel();
p.add(maxObjectSizeLimit);
p.add(effectiveMaxObjectSizeLimit);
grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
Aggregations