org.apache.jmeter.gui.util

Class JLabeledRadioI18N

Implemented Interfaces:
ActionListener, JLabeledField

public class JLabeledRadioI18N
extends JPanel
implements JLabeledField, ActionListener

JLabeledRadio will create a set of Radio buttons with a label. This is a version of the original JLabelledRadio class, but modified to accept resource names rather than language strings.

Constructor Summary

JLabeledRadioI18N()
Deprecated. - only for use in testing
JLabeledRadioI18N(String label_resouce, String[] item_resources, String selectedItem)

Method Summary

void
actionPerformed(ActionEvent e)
When a radio button is clicked, an ActionEvent is triggered.
void
addChangeListener(ChangeListener pChangeListener)
List
getComponentList()
Method will return all the label and JRadioButtons.
String
getText()
The implementation will get the resource name from the selected radio button in the JButtonGroup.
void
setLabel(String label_resource)
Set the group label from the resource name.
void
setText(String resourcename)
The implementation will iterate through the radio buttons and find the match.

Constructor Details

JLabeledRadioI18N

public JLabeledRadioI18N()

Deprecated. - only for use in testing


JLabeledRadioI18N

public JLabeledRadioI18N(String label_resouce,
                         String[] item_resources,
                         String selectedItem)
Parameters:
label_resouce - text resource name for group label
item_resources - list of resource names for individual buttons
selectedItem - button to be selected (if not null)

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)
When a radio button is clicked, an ActionEvent is triggered.

addChangeListener

public void addChangeListener(ChangeListener pChangeListener)
Specified by:
addChangeListener in interface JLabeledField

getComponentList

public List getComponentList()
Method will return all the label and JRadioButtons. ButtonGroup is excluded from the list.
Specified by:
getComponentList in interface JLabeledField

getText

public String getText()
The implementation will get the resource name from the selected radio button in the JButtonGroup.
Specified by:
getText in interface JLabeledField

setLabel

public final void setLabel(String label_resource)
Set the group label from the resource name.
Specified by:
setLabel in interface JLabeledField
Parameters:
label_resource -

setText

public void setText(String resourcename)
The implementation will iterate through the radio buttons and find the match. It then sets it to selected and sets all other radio buttons as not selected.
Specified by:
setText in interface JLabeledField
Parameters:
resourcename - name of resource whose button is to be selected

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.