CreateEmbeddedControl
This event is sent when an embedded control is encountered during RTF input.
Component CreateEmbeddedControl(TejEvent ev)
{
JComponent ctl=null;
if (ev.ClassName.equals("TextBox")) {
JTextField tb=new JTextField();
if (id==1) tb.setText("Name");
else tb.setText("Address");
return (Component)tb;
}
return (Component) ctl;
}The relevant TejEvent fields:
String ClassName; int id;
Your application would use the event to recreate the embedded control which was originally inserted into the input RTF file using the TerInsertControl method. The value of the 'id' parameter is the same the 'id' parameter value specified when calling the TerInsertControl method.
Tej control already incluses a built-in support for these components: JTextArea, JCheckBox, JComboBox, JButton, JRadioButton, and JLabel. This event is needed to support additional component classes.