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

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

Introduction

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

Prototype

@Override
    public String getName() 

Source Link

Usage

From source file:com.alkacon.geranium.client.ui.input.RadioButtonGroupWidget.java

License:Open Source License

/**
 * @see com.alkacon.geranium.client.ui.input.I_FormWidget#getFormValue()
 *//*www.j  a  v  a2 s  . com*/
public Object getFormValue() {

    RadioButton button = m_group.getSelectedButton();
    if (button == null) {
        return "";
    } else {
        return button.getName();
    }
}

From source file:com.allen_sauer.gwt.dnd.demo.client.example.palette.PaletteWidget.java

License:Apache License

public PaletteWidget cloneWidget() {
    Widget clone;/* w w  w.  j  av  a  2s .  c  om*/

    // Clone our internal widget
    if (widget instanceof Label) {
        Label label = (Label) widget;
        clone = new Label(label.getText());
    } else if (widget instanceof RadioButton) {
        RadioButton radioButton = (RadioButton) widget;
        clone = new RadioButton(radioButton.getName(), radioButton.getHTML(), true);
    } else if (widget instanceof CheckBox) {
        CheckBox checkBox = (CheckBox) widget;
        clone = new CheckBox(checkBox.getHTML(), true);
    } else {
        throw new IllegalStateException("Unhandled Widget class " + widget.getClass().getName());
    }

    // Copy a few obvious common widget properties
    clone.setStyleName(widget.getStyleName());
    clone.setTitle(widget.getTitle());

    // Wrap the cloned widget in a new PaletteWidget instance
    return new PaletteWidget(clone);
}

From source file:com.ponysdk.ui.terminal.ui.PTRadioButton.java

License:Apache License

@Override
protected void addValueChangeHandler(final PTInstruction addHandler, final UIService uiService) {
    final RadioButton radioButton = cast();

    radioButton.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override/*from   w w  w.j av  a2 s.c o m*/
        public void onValueChange(final ValueChangeEvent<Boolean> event) {
            fireInstruction(addHandler.getObjectID(), uiService, event.getValue());

            if (cast().getName() != null) {
                final PTRadioButton previouslySelected = lastSelectedRadioButtonByGroup.get(cast().getName());
                if (previouslySelected != null && !previouslySelected.equals(radioButton)) {
                    fireInstruction(previouslySelected.getObjectID(), uiService,
                            previouslySelected.cast().getValue());
                }
                lastSelectedRadioButtonByGroup.put(radioButton.getName(), PTRadioButton.this);
            }
        }
    });
}

From source file:edu.purdue.pivot.skwiki.client.dnd.PaletteWidget.java

License:Apache License

public PaletteWidget cloneWidget() {
    Widget clone;/*from ww w .  jav  a2 s. c  om*/

    // Clone our internal widget
    if (widget instanceof Label) {
        Label label = (Label) widget;
        clone = new Label(label.getText());
    } else if (widget instanceof RadioButton) {
        RadioButton radioButton = (RadioButton) widget;
        clone = new RadioButton(radioButton.getName(), radioButton.getHTML(), true);
    } else if (widget instanceof CheckBox) {
        CheckBox checkBox = (CheckBox) widget;
        clone = new CheckBox(checkBox.getHTML(), true);
    } else if (widget instanceof TextWindow) {
        TextWindow editWindow = (TextWindow) widget;
        clone = new TextWindow();
    } else if (widget instanceof CanvasWindow) {
        CanvasWindow editWindow = (CanvasWindow) widget;
        clone = new CanvasWindow();
    } else {
        throw new IllegalStateException("Unhandled Widget class " + widget.getClass().getName());
    }

    // Copy a few obvious common widget properties
    clone.setStyleName(widget.getStyleName());
    clone.setTitle(widget.getTitle());

    // Wrap the cloned widget in a new PaletteWidget instance
    return new PaletteWidget(clone);
}