use of com.google.gwt.user.client.ui.ListBox in project gwt-test-utils by gwt-test-utils.
the class ListBoxTest method name.
@Test
public void name() {
// Given
ListBox listBox = new ListBox(false);
// When
listBox.setName("name");
// Then
assertThat(listBox.getName()).isEqualTo("name");
}
use of com.google.gwt.user.client.ui.ListBox in project gwt-test-utils by gwt-test-utils.
the class ListBoxTest method isMultipleSelect.
@SuppressWarnings("deprecation")
@Test
public void isMultipleSelect() {
// Given
ListBox listBox = new ListBox(false);
// Preconditions
assertThat(listBox.isMultipleSelect()).isEqualTo(false);
// When
listBox.setMultipleSelect(true);
// Then
assertThat(listBox.isMultipleSelect()).isEqualTo(true);
}
use of com.google.gwt.user.client.ui.ListBox in project gwt-test-utils by gwt-test-utils.
the class ListBoxTest method title.
@Test
public void title() {
// Given
ListBox listBox = new ListBox(false);
// When
listBox.setTitle("title");
// Then
assertThat(listBox.getTitle()).isEqualTo("title");
}
use of com.google.gwt.user.client.ui.ListBox in project gwt-test-utils by gwt-test-utils.
the class ListBoxTest method visible.
@Test
public void visible() {
// Given
ListBox listBox = new ListBox(false);
// Preconditions
assertThat(listBox.isVisible()).isEqualTo(true);
// When
listBox.setVisible(false);
// Then
assertThat(listBox.isVisible()).isEqualTo(false);
}
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;
}
Aggregations