public class OleControl
extends java.lang.Object
To learn more, visit the Working with Ole Objects documentation article.
Examples:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CHECK_BOX_CONTROL_CLSID |
protected static java.lang.String |
COMBO_BOX_CONTROL_CLSID |
protected static java.lang.String |
COMMAND_BUTTON_CONTROL_CLSID |
protected static java.lang.String |
FORM_CONTROL_CLSID |
protected static java.lang.String |
FRAME_CONTROL_CLSID |
protected static java.lang.String |
HTML_HIDDEN_CLSID |
protected static java.lang.String |
HTML_SELECT_CLSID |
protected static java.lang.String |
HTML_SUBMIT_BUTTON_CLSID |
protected static java.lang.String |
HTML_TEXT_CLSID |
protected static java.lang.String |
IMAGE_CONTROL_CLSID |
protected static java.lang.String |
LABEL_CONTROL_CLSID |
protected static java.lang.String |
LIST_BOX_CONTROL_CLSID |
protected static java.lang.String |
MULTI_PAGE_CONTROL_CLSID |
protected static java.lang.String |
OPTION_BUTTON_CONTROL_CLSID |
protected static java.lang.String |
SCROLL_BAR_CONTROL_CLSID |
protected static java.lang.String |
SPIN_BUTTON_CONTROL_CLSID |
protected static java.lang.String |
TAB_STRIP_CONTROL_CLSID |
protected static java.lang.String |
TEXT_BOX_CONTROL_CLSID |
protected static java.lang.String |
TOGGLE_BUTTON_CONTROL_CLSID |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getClsidInternal() |
protected java.lang.String |
getClsidVirtual() |
java.lang.String |
getExtensionForUser(java.lang.String progId) |
java.lang.String |
getFileNameForUser() |
int |
getId() |
java.lang.String |
getName()
Gets name of the ActiveX control.
|
protected java.lang.String |
getProgId() |
protected java.lang.String |
getUserType() |
boolean |
isEmpty() |
boolean |
isForms2OleControl()
Returns
true if the control is a Forms2OleControl. |
boolean |
isForms2OleControlInternal() |
void |
setId(int value) |
void |
setName(java.lang.String value)
Sets name of the ActiveX control.
|
protected static java.lang.String HTML_SELECT_CLSID
protected static java.lang.String HTML_SUBMIT_BUTTON_CLSID
protected static java.lang.String HTML_HIDDEN_CLSID
protected static java.lang.String HTML_TEXT_CLSID
protected static java.lang.String OPTION_BUTTON_CONTROL_CLSID
protected static java.lang.String LABEL_CONTROL_CLSID
protected static java.lang.String TEXT_BOX_CONTROL_CLSID
protected static java.lang.String CHECK_BOX_CONTROL_CLSID
protected static java.lang.String TOGGLE_BUTTON_CONTROL_CLSID
protected static java.lang.String SPIN_BUTTON_CONTROL_CLSID
protected static java.lang.String COMBO_BOX_CONTROL_CLSID
protected static java.lang.String COMMAND_BUTTON_CONTROL_CLSID
protected static java.lang.String IMAGE_CONTROL_CLSID
protected static java.lang.String SCROLL_BAR_CONTROL_CLSID
protected static java.lang.String TAB_STRIP_CONTROL_CLSID
protected static java.lang.String LIST_BOX_CONTROL_CLSID
protected static java.lang.String FORM_CONTROL_CLSID
protected static java.lang.String FRAME_CONTROL_CLSID
protected static java.lang.String MULTI_PAGE_CONTROL_CLSID
public java.lang.String getName()
Examples:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}
public void setName(java.lang.String value)
Examples:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}
value - Name of the ActiveX control.public boolean isForms2OleControl()
true if the control is a Forms2OleControl.
Examples:
Shows how to verify the properties of an ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true);
OleControl oleControl = shape.getOleFormat().getOleControl();
Assert.assertEquals(oleControl.getName(), "CheckBox1");
if (oleControl.isForms2OleControl()) {
Forms2OleControl checkBox = (Forms2OleControl) oleControl;
Assert.assertEquals(checkBox.getCaption(), "First");
Assert.assertEquals(checkBox.getValue(), "0");
Assert.assertEquals(checkBox.getEnabled(), true);
Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX);
Assert.assertEquals(checkBox.getChildNodes(), null);
}
true if the control is a Forms2OleControl.public java.lang.String getExtensionForUser(java.lang.String progId)
public java.lang.String getFileNameForUser()
public boolean isForms2OleControlInternal()
public java.lang.String getClsidInternal()
public int getId()
public void setId(int value)
public boolean isEmpty()
protected java.lang.String getClsidVirtual()
protected java.lang.String getUserType()
protected java.lang.String getProgId()