Example usage for com.google.gwt.user.client.ui RadioButton isEnabled

List of usage examples for com.google.gwt.user.client.ui RadioButton isEnabled

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui RadioButton isEnabled.

Prototype

@Override
    public boolean isEnabled() 

Source Link

Usage

From source file:com.vaadin.client.ui.VRadioButtonGroup.java

License:Apache License

@Override
public void onClick(ClickEvent event) {
    if (event.getSource() instanceof RadioButton) {
        RadioButton source = (RadioButton) event.getSource();
        if (!source.isEnabled()) {
            // Click events on the text are received even though the
            // radiobutton is disabled
            return;
        }/*from  ww  w  .  j a  v a 2  s.  c  o m*/
        if (BrowserInfo.get().isWebkit() || BrowserInfo.get().isIE11()) {
            // Webkit does not focus non-text input elements on click
            // (#11854)
            source.setFocus(true);
        }

        JsonObject item = optionsToItems.get(source);
        assert item != null;

        new ArrayList<>(selectionChangeListeners).forEach(listener -> listener.accept(item));
    }
}