Hey guys,

I'd like to extend a tool with a listener. But up to now I have problems with doing that.
Hopefully you can help me. Here you can see the class I'd like to extend:

/freeplane/freeplane_program/trunk : contents of freeplane/src/org/freeplane/features/mindmapmode/text/MTextController.java at revision 1434

I think the relevant parts are between line 85 and 93 and between 547 and 559. But I'm not 100 % sure. Maybe there is another code
relevant for you to help me. There is also an Interface I have to implement:

/freeplane/freeplane_program/trunk : contents of freeplane/src/org/freeplane/features/mindmapmode/text/IEditorPaneListener.java at revision 1434


My aim is to create a new project. So far my code is in the same project like the code posted above (links).
So I created my listener:

Java Code:
public class MyEditorPaneListener {

 final ModeController modeController = Controller.getCurrentModeController();
 final MTextController textController = (MTextController) TextController.getController(modeController);
 
 public MyEditorPaneListener() {
  textController.addEditorPaneListener(new IEditorPaneListener() {
   
   public void editorPaneCreated(JEditorPane editor, Object purpose) {
    // TODO Auto-generated method stub
    
   }
  });
  //implementation
 }
}
Firstly I'm not sure if this is correct. Secondly I think I have to call the listener...but where?
If I call the listener within the MTextController class, I would get a circle if I put my code in my own project.
Maybe you can help me.

Regards