java.lang.ObjectOleControl
com.aspose.words.Forms2OleControl
public abstract class Forms2OleControl
Property Getters/Setters Summary | ||
---|---|---|
java.lang.String | getCaption() | |
Gets Caption property of control. Default value is an empty string. | ||
Forms2OleControlCollection | getChildNodes() | |
Gets collection of immediate child controls. | ||
boolean | getEnabled() | |
Returns true if control is in enabled state. | ||
boolean | isForms2OleControl() | → inherited from OleControl |
Returns true if the control is a |
||
java.lang.String | getName() | → inherited from OleControl |
Gets name of the ActiveX control. | ||
int | getType() | |
Gets type of Forms 2.0 control. The value of the property is Forms2OleControlType integer constant. | ||
java.lang.String | getValue() | |
Gets underlying Value property which often represents control state. For example checked option button has '1' value while unchecked has '0'. Default value is an empty string. |
Property Getters/Setters Detail |
---|
getCaption | |
public java.lang.String getCaption() |
Example:
Shows how to get ActiveX control and properties from the document.Document doc = new Document(getMyDir() + "Shape.ActiveXObject.docx"); //Get ActiveX control from the document Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true); OleControl oleControl = shape.getOleFormat().getOleControl(); //Get ActiveX control properties if (oleControl.isForms2OleControl()) { Forms2OleControl checkBox = (Forms2OleControl)oleControl; Assert.assertEquals(checkBox.getCaption(), "Первый"); Assert.assertEquals(checkBox.getValue(), "0"); Assert.assertEquals(checkBox.getEnabled(), true); Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX); Assert.assertEquals(checkBox.getChildNodes(), null); }
getChildNodes | |
public Forms2OleControlCollection getChildNodes() |
Example:
Shows how to get ActiveX control and properties from the document.Document doc = new Document(getMyDir() + "Shape.ActiveXObject.docx"); //Get ActiveX control from the document Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true); OleControl oleControl = shape.getOleFormat().getOleControl(); //Get ActiveX control properties if (oleControl.isForms2OleControl()) { Forms2OleControl checkBox = (Forms2OleControl)oleControl; Assert.assertEquals(checkBox.getCaption(), "Первый"); Assert.assertEquals(checkBox.getValue(), "0"); Assert.assertEquals(checkBox.getEnabled(), true); Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX); Assert.assertEquals(checkBox.getChildNodes(), null); }
getEnabled | |
public boolean getEnabled() |
Example:
Shows how to get ActiveX control and properties from the document.Document doc = new Document(getMyDir() + "Shape.ActiveXObject.docx"); //Get ActiveX control from the document Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true); OleControl oleControl = shape.getOleFormat().getOleControl(); //Get ActiveX control properties if (oleControl.isForms2OleControl()) { Forms2OleControl checkBox = (Forms2OleControl)oleControl; Assert.assertEquals(checkBox.getCaption(), "Первый"); Assert.assertEquals(checkBox.getValue(), "0"); Assert.assertEquals(checkBox.getEnabled(), true); Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX); Assert.assertEquals(checkBox.getChildNodes(), null); }
isForms2OleControl | → inherited from OleControl |
public boolean isForms2OleControl() |
getName | → inherited from OleControl |
public java.lang.String getName() |
getType | |
public int getType() |
Example:
Shows how to get ActiveX control and properties from the document.Document doc = new Document(getMyDir() + "Shape.ActiveXObject.docx"); //Get ActiveX control from the document Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true); OleControl oleControl = shape.getOleFormat().getOleControl(); //Get ActiveX control properties if (oleControl.isForms2OleControl()) { Forms2OleControl checkBox = (Forms2OleControl)oleControl; Assert.assertEquals(checkBox.getCaption(), "Первый"); Assert.assertEquals(checkBox.getValue(), "0"); Assert.assertEquals(checkBox.getEnabled(), true); Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX); Assert.assertEquals(checkBox.getChildNodes(), null); }
getValue | |
public java.lang.String getValue() |
Example:
Shows how to get ActiveX control and properties from the document.Document doc = new Document(getMyDir() + "Shape.ActiveXObject.docx"); //Get ActiveX control from the document Shape shape = (Shape) doc.getChild(NodeType.SHAPE, 0, true); OleControl oleControl = shape.getOleFormat().getOleControl(); //Get ActiveX control properties if (oleControl.isForms2OleControl()) { Forms2OleControl checkBox = (Forms2OleControl)oleControl; Assert.assertEquals(checkBox.getCaption(), "Первый"); Assert.assertEquals(checkBox.getValue(), "0"); Assert.assertEquals(checkBox.getEnabled(), true); Assert.assertEquals(checkBox.getType(), Forms2OleControlType.CHECK_BOX); Assert.assertEquals(checkBox.getChildNodes(), null); }