public class JCListener extends Object implements IJCListener
JCListener class represents a generic implementation of event
raiser class to CLR
Extend this class and implement the event of interest. An implementation of
ActionListener is the following one. It can be used as starting
point example, it pairs with the example in C# documentation counterpart:
public final class JCActionListener extends JCListener implements ActionListener {
public JCActionListener(String key) throws JCNativeException {
super(key);
}
public void actionPerformed(ActionEvent e) {
raiseEvent("actionPerformed", e);
}
}
| Constructor and Description |
|---|
JCListener(String key) |
| Modifier and Type | Method and Description |
|---|---|
Object[] |
extraData()
Invoked from the CLR to get extra information.
|
int |
extraDataLength()
Invoked from the CLR to know how many
Object contains extra information. |
Object |
getEventData()
Invoked from the CLR counterpart to get the event
Object. |
Object |
getReturnData()
Invoked from the JVM to get the event return
Object. |
boolean |
hasExtraData()
Invoked from the CLR to know if the event has extra information.
|
void |
raiseEvent(String eventName)
Invoked when an action occurs.
|
void |
raiseEvent(String eventName,
Object e)
Invoked when an action occurs.
|
void |
raiseEvent(String eventName,
Object e,
Object... objects)
Invoked when an action occurs.
|
void |
release()
Invoked when the CLR counterpart request to release the instance.
|
void |
setReturnData(Object retData)
Invoked from the CLR counterpart to set the event return
Object. |
public JCListener(String key) throws JCNativeException
JCNativeExceptionpublic void release()
release in interface IJCListenerpublic void raiseEvent(String eventName)
raiseEvent in interface IJCListenereventName - The name of the remote method to be invokedpublic void raiseEvent(String eventName, Object e)
raiseEvent in interface IJCListenereventName - The name of the remote method to be invokede - The event raisedpublic void raiseEvent(String eventName, Object e, Object... objects)
raiseEvent in interface IJCListenereventName - The name of the remote method to be invokede - The event raisedobjects - Extra objects associated to the eventpublic Object getEventData()
Object.getEventData in interface IJCListenerObject associated to the event raisedpublic boolean hasExtraData()
hasExtraData in interface IJCListenerpublic int extraDataLength()
Object contains extra information.extraDataLength in interface IJCListenerpublic Object[] extraData()
extraData in interface IJCListenerpublic Object getReturnData()
Object.getReturnData in interface IJCListenerObject returned from the event raisedpublic void setReturnData(Object retData)
Object.setReturnData in interface IJCListenerretData - The Object returned from CLR