Search in sources :

Example 21 with RadioButton

use of com.google.gwt.user.client.ui.RadioButton in project cuba by cuba-platform.

the class CubaRadioButtonGroupWidget method buildOptions.

@Override
public void buildOptions(List<JsonObject> items) {
    super.buildOptions(items);
    for (Widget widget : getWidget()) {
        if (widget instanceof RadioButton) {
            ((RadioButton) widget).addKeyDownHandler(this);
            ((RadioButton) widget).addValueChangeHandler(this);
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) RadioButton(com.google.gwt.user.client.ui.RadioButton)

Example 22 with RadioButton

use of com.google.gwt.user.client.ui.RadioButton in project cuba by cuba-platform.

the class CubaRadioButtonGroupWidget method updateItemsSelection.

protected void updateItemsSelection() {
    for (Widget widget : getWidget()) {
        if (widget instanceof RadioButton) {
            boolean checked = widget.getElement().hasClassName(CLASSNAME_OPTION_SELECTED);
            updateItemSelection((RadioButton) widget, checked);
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) RadioButton(com.google.gwt.user.client.ui.RadioButton)

Example 23 with RadioButton

use of com.google.gwt.user.client.ui.RadioButton in project ovirt-engine by oVirt.

the class VmRunOncePopupWidget method initRadioButtonEditors.

void initRadioButtonEditors() {
    // $NON-NLS-1$
    runOnceHeadlessModeEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    displayConsoleVncEditor = new EntityModelRadioButtonEditor("1");
    // $NON-NLS-1$
    displayConsoleSpiceEditor = new EntityModelRadioButtonEditor("1");
    runOnceHeadlessModeEnabledInfoIcon = new InfoIcon(SafeHtmlUtils.fromTrustedString(constants.runOnceHeadlessModeExplanation()));
    // host tab
    // $NON-NLS-1$
    specificHost = new RadioButton("runVmOnHostGroup");
    // $NON-NLS-1$
    isAutoAssignEditor = new EntityModelRadioButtonEditor("runVmOnHostGroup");
}
Also used : InfoIcon(org.ovirt.engine.ui.common.widget.dialog.InfoIcon) RadioButton(com.google.gwt.user.client.ui.RadioButton) EntityModelRadioButtonEditor(org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)

Example 24 with RadioButton

use of com.google.gwt.user.client.ui.RadioButton in project gwt-test-utils by gwt-test-utils.

the class RadioButtonTest method click_Twice_ClickHandler.

@Test
public void click_Twice_ClickHandler() {
    // Given
    tested = false;
    RadioButton r1 = new RadioButton("myRadioGroup", "r1");
    RadioButton r2 = new RadioButton("myRadioGroup", "r2");
    r1.addClickHandler(event -> tested = !tested);
    r2.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            tested = !tested;
        }
    });
    // Preconditions
    assertThat(tested).isEqualTo(false);
    // When
    Browser.click(r1);
    Browser.click(r1);
    // Then
    assertThat(tested).isEqualTo(false);
    assertThat(r1.getValue()).isEqualTo(true);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) RadioButton(com.google.gwt.user.client.ui.RadioButton) Test(org.junit.Test)

Example 25 with RadioButton

use of com.google.gwt.user.client.ui.RadioButton in project gwt-test-utils by gwt-test-utils.

the class RadioButtonTest method title.

@Test
public void title() {
    // Given
    RadioButton rb = new RadioButton("myRadioGroup", "foo");
    // Preconditions
    assertThat(rb.getTitle()).isEqualTo("");
    // When
    rb.setTitle("title");
    // Then
    assertThat(rb.getTitle()).isEqualTo("title");
}
Also used : RadioButton(com.google.gwt.user.client.ui.RadioButton) Test(org.junit.Test)

Aggregations

RadioButton (com.google.gwt.user.client.ui.RadioButton)31 Test (org.junit.Test)11 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)4 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 Label (com.google.gwt.user.client.ui.Label)4 Widget (com.google.gwt.user.client.ui.Widget)4 MockValueChangeHandler (com.googlecode.gwt.MockValueChangeHandler)4 InputElement (com.google.gwt.dom.client.InputElement)3 Element (com.google.gwt.dom.client.Element)2 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)2 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 EntityModelCheckBoxEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor)2 EntityModelRadioButtonEditor (org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor)2 StringEntityModelTextAreaLabelEditor (org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextAreaLabelEditor)2 AgreementInfo (com.google.gerrit.client.info.AgreementInfo)1 SmallHeading (com.google.gerrit.client.ui.SmallHeading)1 HeadingElement (com.google.gwt.dom.client.HeadingElement)1 Node (com.google.gwt.dom.client.Node)1