List of usage examples for com.google.gwt.user.client.ui RadioButton getHTML
@Override
public String getHTML()
From source file:com.allen_sauer.gwt.dnd.demo.client.example.palette.PaletteWidget.java
License:Apache License
public PaletteWidget cloneWidget() { Widget clone;/*from ww w . j a va 2 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 { 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 w ww . 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); }
From source file:edu.ucdenver.bios.glimmpseweb.client.guided.InteractionVariablePanel.java
License:Open Source License
/** * Constructor./*from w ww . j av a2 s.c o m*/ * @param label display for the checkbox * @param numLevels number of levels for the variable associated with this * panel. Used to display valid trend tests. * @param handler click event handler */ public InteractionVariablePanel(String label, int numLevels) { this.label = label; // overall composite panel VerticalPanel panel = new VerticalPanel(); // main layout container Grid grid = new Grid(1, 2); // create the selection box for this variable checkBox = new CheckBox(label); checkBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { boolean checked = ((CheckBox) event.getSource()).getValue(); showTrendInformation(checked); } }); // build the selected trend display panel selectedTrendPanel.add(editTrendButton); selectedTrendPanel.add(new HTML(GlimmpseWeb.constants.editTrendSelectedTrendPrefix())); selectedTrendPanel.add(selectedTrendHTML); // create the edit trend panel editTrendPanel = new EditTrendPanel(label, numLevels); trendPanel.add(editTrendPanel); editTrendPanel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { RadioButton radioButton = (RadioButton) event.getSource(); // update the selected trend information selectedTrendHTML.setText(radioButton.getHTML()); trendPanel.setVisible(false); } }); // layout the top panel for the checkbox and trend display grid.setWidget(0, 0, checkBox); grid.setWidget(0, 1, selectedTrendPanel); // layout the overall panel panel.add(grid); panel.add(trendPanel); // add style editTrendButton.setStyleName(GlimmpseConstants.STYLE_WIZARD_STEP_BUTTON); // hide trend info to start reset(); initWidget(panel); }