Search in sources :

Example 16 with ListBox

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");
}
Also used : ListBox(com.google.gwt.user.client.ui.ListBox) Test(org.junit.Test)

Example 17 with ListBox

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);
}
Also used : ListBox(com.google.gwt.user.client.ui.ListBox) Test(org.junit.Test)

Example 18 with ListBox

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");
}
Also used : ListBox(com.google.gwt.user.client.ui.ListBox) Test(org.junit.Test)

Example 19 with ListBox

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);
}
Also used : ListBox(com.google.gwt.user.client.ui.ListBox) Test(org.junit.Test)

Example 20 with ListBox

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;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) CheckBox(com.google.gwt.user.client.ui.CheckBox) ListBox(com.google.gwt.user.client.ui.ListBox)

Aggregations

ListBox (com.google.gwt.user.client.ui.ListBox)25 Test (org.junit.Test)10 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)5 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)5 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 CheckBox (com.google.gwt.user.client.ui.CheckBox)5 Label (com.google.gwt.user.client.ui.Label)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)3 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)3 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)2 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)2 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)2 Button (com.google.gwt.user.client.ui.Button)2 FlexTable (com.google.gwt.user.client.ui.FlexTable)2 Grid (com.google.gwt.user.client.ui.Grid)2 HTML (com.google.gwt.user.client.ui.HTML)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 TextBox (com.google.gwt.user.client.ui.TextBox)2