public class OptionButtonControl extends MorphDataControl
Examples:
Shows how to select radio button.
Document doc = new Document(getMyDir() + "Radio buttons.docx");
Shape shape1 = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
OptionButtonControl optionButton1 = (OptionButtonControl)shape1.getOleFormat().getOleControl();
// Deselect selected first item.
optionButton1.setSelected(false);
Shape shape2 = (Shape)doc.getChild(NodeType.SHAPE, 1, true);
OptionButtonControl optionButton2 = (OptionButtonControl)shape2.getOleFormat().getOleControl();
// Select second option button.
optionButton2.setSelected(true);
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton1.getType());
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton2.getType());
doc.save(getArtifactsDir() + "Shape.SelectRadioControl.docx");
CHECK_BOX_CONTROL_CLSID, COMBO_BOX_CONTROL_CLSID, COMMAND_BUTTON_CONTROL_CLSID, FORM_CONTROL_CLSID, FRAME_CONTROL_CLSID, HTML_HIDDEN_CLSID, HTML_SELECT_CLSID, HTML_SUBMIT_BUTTON_CLSID, HTML_TEXT_CLSID, IMAGE_CONTROL_CLSID, LABEL_CONTROL_CLSID, LIST_BOX_CONTROL_CLSID, MULTI_PAGE_CONTROL_CLSID, OPTION_BUTTON_CONTROL_CLSID, SCROLL_BAR_CONTROL_CLSID, SPIN_BUTTON_CONTROL_CLSID, TAB_STRIP_CONTROL_CLSID, TEXT_BOX_CONTROL_CLSID, TOGGLE_BUTTON_CONTROL_CLSID| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getClsidVirtual() |
boolean |
getSelected()
Gets a boolean value indicating either this
OptionButtonControl is selected or not. |
int |
getType()
Gets type of Forms 2.0 control.
|
void |
setSelected(boolean value)
Sets a boolean value indicating either this
OptionButtonControl is selected or not. |
getBackColor, getCaption, getChildNodes, getEnabled, getForeColor, getGroupName, getHeight, getProgId, getUserType, getValue, getWidth, setBackColor, setCaption, setForeColor, setGroupName, setHeight, setWidthgetClsidInternal, getExtensionForUser, getFileNameForUser, getId, getName, isEmpty, isForms2OleControl, isForms2OleControlInternal, setId, setNamepublic int getType()
Examples:
Shows how to select radio button.
Document doc = new Document(getMyDir() + "Radio buttons.docx");
Shape shape1 = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
OptionButtonControl optionButton1 = (OptionButtonControl)shape1.getOleFormat().getOleControl();
// Deselect selected first item.
optionButton1.setSelected(false);
Shape shape2 = (Shape)doc.getChild(NodeType.SHAPE, 1, true);
OptionButtonControl optionButton2 = (OptionButtonControl)shape2.getOleFormat().getOleControl();
// Select second option button.
optionButton2.setSelected(true);
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton1.getType());
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton2.getType());
doc.save(getArtifactsDir() + "Shape.SelectRadioControl.docx");
getType in class Forms2OleControlForms2OleControlType constants.public boolean getSelected()
OptionButtonControl is selected or not.
Remarks:
Note, this property allows you to select multiple items in a group of OptionButtonControl with the same Forms2OleControl.getGroupName() / Forms2OleControl.setGroupName(java.lang.String). It is up to you to take care of deselecting a previously selected item when you make this OptionButtonControl selected.
Examples:
Shows how to select radio button.
Document doc = new Document(getMyDir() + "Radio buttons.docx");
Shape shape1 = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
OptionButtonControl optionButton1 = (OptionButtonControl)shape1.getOleFormat().getOleControl();
// Deselect selected first item.
optionButton1.setSelected(false);
Shape shape2 = (Shape)doc.getChild(NodeType.SHAPE, 1, true);
OptionButtonControl optionButton2 = (OptionButtonControl)shape2.getOleFormat().getOleControl();
// Select second option button.
optionButton2.setSelected(true);
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton1.getType());
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton2.getType());
doc.save(getArtifactsDir() + "Shape.SelectRadioControl.docx");
OptionButtonControl is selected or not.public void setSelected(boolean value)
OptionButtonControl is selected or not.
Remarks:
Note, this property allows you to select multiple items in a group of OptionButtonControl with the same Forms2OleControl.getGroupName() / Forms2OleControl.setGroupName(java.lang.String). It is up to you to take care of deselecting a previously selected item when you make this OptionButtonControl selected.
Examples:
Shows how to select radio button.
Document doc = new Document(getMyDir() + "Radio buttons.docx");
Shape shape1 = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
OptionButtonControl optionButton1 = (OptionButtonControl)shape1.getOleFormat().getOleControl();
// Deselect selected first item.
optionButton1.setSelected(false);
Shape shape2 = (Shape)doc.getChild(NodeType.SHAPE, 1, true);
OptionButtonControl optionButton2 = (OptionButtonControl)shape2.getOleFormat().getOleControl();
// Select second option button.
optionButton2.setSelected(true);
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton1.getType());
Assert.assertEquals(Forms2OleControlType.OPTION_BUTTON, optionButton2.getType());
doc.save(getArtifactsDir() + "Shape.SelectRadioControl.docx");
value - A boolean value indicating either this OptionButtonControl is selected or not.protected java.lang.String getClsidVirtual()
getClsidVirtual in class OleControl