Something like this:
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;
class MyRadioButton extends RadioButton implements ClickListener
{
private static MyRadioButton currentButton = null;
public MyRadioButton(String name, String label)
{
super(name, label);
addClickListener(this);
}
public void onClick(Widget sender)
{
// Save current instance - you could just save the text to save
// memory, but you might well want to add getters for other
// attributes of the current instance
currentButton = (MyRadioButton) sender;
}
public static String getCurrentText()
{
// Might not yet be set
if(currentButton == null) return null;
// Return the text
return currentButton.getText();
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---