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
JCNativeException
public void release()
release
in interface IJCListener
public void raiseEvent(String eventName)
raiseEvent
in interface IJCListener
eventName
- The name of the remote method to be invokedpublic void raiseEvent(String eventName, Object e)
raiseEvent
in interface IJCListener
eventName
- The name of the remote method to be invokede
- The event raisedpublic void raiseEvent(String eventName, Object e, Object... objects)
raiseEvent
in interface IJCListener
eventName
- The name of the remote method to be invokede
- The event raisedobjects
- Extra objects associated to the eventpublic Object getEventData()
Object
.getEventData
in interface IJCListener
Object
associated to the event raisedpublic boolean hasExtraData()
hasExtraData
in interface IJCListener
public int extraDataLength()
Object
contains extra information.extraDataLength
in interface IJCListener
public Object[] extraData()
extraData
in interface IJCListener
public Object getReturnData()
Object
.getReturnData
in interface IJCListener
Object
returned from the event raisedpublic void setReturnData(Object retData)
Object
.setReturnData
in interface IJCListener
retData
- The Object
returned from CLR