Package com.ms.ui |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class UIRadioTree extends UITree { // Constructors public UIRadioTree(); public UIRadioTree(String s); public UIRadioTree(Image i, String s); public UIRadioTree(Component comp); public UIRadioTree(Component comp, int indent); // Methods public Component add(String s, int pos); public Component add(Image i, String s, int pos); public boolean action(Event e, Object o); public void setSelectedItem(Component comp); }
A class that implements a radio selection tree control. Each child item you add to a UIRadioTree object automatically becomes a radio button under that tree node. Note that the UIRadioTree node itself does not appear as a radio button. Use UIRadioButton to manually add a radio button image to the node, as shown in the following example.
// Construct a radio tree node with the // radio button image. UIRadioTree r = new UIRadioTree(new UIRadioButton("Radio Tree"));
For more information about using tree controls, see the UITree overview.
public UIRadioTree();Creates a new tree node with no content.
Remarks:
Call the add method to add items to the tree node list.
public UIRadioTree(String s);Creates a new tree node using the specified text for content.
Parameter Description s The text to be displayed with the node. Remarks:
Call the add method to add items to the tree node list.
public UIRadioTree(Image i, String s);Creates a new tree node using the specified image and text for content.
Parameter Description i The image to be displayed with the node. s The text to be displayed with the node. Remarks:
Call the add method to add items to the tree node list.
public UIRadioTree(Component comp);Creates a new tree node using the specified component for content.
Parameter Description comp The component to be displayed with the node. Remarks:
Call the add method to add items to the tree node list.
public UIRadioTree(Component comp, int indent);Creates a new tree node using the specified component for content and the specified indent.
Parameter Description comp The component to be displayed with the node. indent The indent (in pixels) to be used when laying out node children. Remarks:
Call the add method to add items to the tree node list.
public boolean action(Event e, Object o);Determines whether the tree node was double-clicked, and, if so, toggles the expanded state.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter Description e The event posted to the tree control. o The component that was double-clicked. Remarks:
The mouseDown event method (inherited through UISelector) generates an action event when the tree node is double-clicked. If the node was expanded when double-clicked, this method collapses the node; if the node was collapsed, this method expands the node.
public Component add(String s, int pos);Adds a radio button to the tree node list at the specified position. The radio button displays the specified text.
Return Value:
Returns the radio button component that was added.
Parameter Description s The text for the radio button. pos The indexed position at which to add the radio button. The first position in the list is identified by 0; the end of the list is identified by -1. Remarks:
The newly-added child component is shown or hidden, according to the tree node's expanded state. To remove the component, call remove (inherited through UITree).
public Component add(Image i, String s, int pos);Adds a radio button to the tree node list at the specified position. The radio button displays the specified image and text.
Return Value:
Returns the radio button component that was added.
Parameter Description i The image for the radio button. s The text for the radio button. pos The indexed position at which to add the radio button. The first position in the list is identified by 0; the end of the list is identified by -1. Remarks:
The newly-added child component is shown or hidden, according to the tree node's expanded state. To remove the component, call remove (inherited through UITree).
public void setSelectedItem(Component comp);Sets the selection to the specified component in the radio tree node.
Return Value:
No return value.
Parameter Description comp The component item to be selected. Remarks:
If the specified component item is a radio button, this method sets or clears the button's checked state (as appropriate).
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.