Example usage for com.google.gwt.user.client.ui CheckBox getHTML

List of usage examples for com.google.gwt.user.client.ui CheckBox getHTML

Introduction

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

Prototype

@Override
    public String getHTML() 

Source Link

Usage

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

License:Apache License

public PaletteWidget cloneWidget() {
    Widget clone;/*ww w.j  a va 2  s. co  m*/

    // 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:edu.purdue.pivot.skwiki.client.dnd.PaletteWidget.java

License:Apache License

public PaletteWidget cloneWidget() {
    Widget clone;//from www  . ja v  a2s  .  c o  m

    // 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);
}