public abstract class Forms2OleControl extends OleControl
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);
}
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| Constructor and Description |
|---|
Forms2OleControl() |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getBackColor()
Gets a background color of the control.
|
java.lang.String |
getCaption()
Gets a Caption property of the control.
|
Forms2OleControlCollection |
getChildNodes()
Gets collection of immediate child controls.
|
boolean |
getEnabled()
Returns
true if control is in enabled state. |
java.awt.Color |
getForeColor()
Gets a foreground color of the control.
|
java.lang.String |
getGroupName()
Gets a string that specifies a group of mutually exclusive controls.
|
double |
getHeight()
Gets a height of the control in points.
|
protected java.lang.String |
getProgId() |
abstract int |
getType()
Gets type of Forms 2.0 control.
|
protected java.lang.String |
getUserType() |
java.lang.String |
getValue()
Gets underlying Value property which often represents control state.
|
double |
getWidth()
Gets a width of the control in points.
|
void |
setBackColor(java.awt.Color value)
Sets a background color of the control.
|
void |
setCaption(java.lang.String value)
Sets a Caption property of the control.
|
void |
setForeColor(java.awt.Color value)
Sets a foreground color of the control.
|
void |
setGroupName(java.lang.String value)
Sets a string that specifies a group of mutually exclusive controls.
|
void |
setHeight(double value)
Sets a height of the control in points.
|
void |
setWidth(double value)
Sets a width of the control in points.
|
getClsidInternal, getClsidVirtual, getExtensionForUser, getFileNameForUser, getId, getName, isEmpty, isForms2OleControl, isForms2OleControlInternal, setId, setNamepublic java.lang.String getCaption()
Examples:
Shows how to set caption for ActiveX control.
DocumentBuilder builder = new DocumentBuilder();
CommandButtonControl button1 = new CommandButtonControl(); { button1.setCaption("Button caption"); }
Shape shape = builder.insertForms2OleControl(button1);
Assert.assertEquals("Button caption", button1.getCaption());
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 setCaption(java.lang.String value)
Examples:
Shows how to set caption for ActiveX control.
DocumentBuilder builder = new DocumentBuilder();
CommandButtonControl button1 = new CommandButtonControl(); { button1.setCaption("Button caption"); }
Shape shape = builder.insertForms2OleControl(button1);
Assert.assertEquals("Button caption", button1.getCaption());
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 - A Caption property of the control.public java.lang.String getValue()
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 boolean getEnabled()
true if control is in enabled state.
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 control is in enabled state.public Forms2OleControlCollection getChildNodes()
Remarks:
Returns null if this control can not have children.
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 abstract int getType()
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);
}
Forms2OleControlType constants.public java.lang.String getGroupName()
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 setGroupName(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 - A string that specifies a group of mutually exclusive controls.public java.awt.Color getForeColor()
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
public void setForeColor(java.awt.Color value)
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
value - A foreground color of the control.public java.awt.Color getBackColor()
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
public void setBackColor(java.awt.Color value)
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
value - A background color of the control.public double getWidth()
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
public void setWidth(double value)
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
value - A width of the control in points.public double getHeight()
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
public void setHeight(double value)
Examples:
Shows how to set properties for ActiveX control.
Document doc = new Document(getMyDir() + "ActiveX controls.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Forms2OleControl oleControl = (Forms2OleControl)shape.getOleFormat().getOleControl();
oleControl.setForeColor(new Color((0x17), (0xE1), (0x35)));
oleControl.setBackColor(new Color((0x33), (0x97), (0xF4)));
oleControl.setHeight(100.54);
oleControl.setWidth(201.06);
value - A height of the control in points.protected java.lang.String getUserType()
getUserType in class OleControlprotected java.lang.String getProgId()
getProgId in class OleControl