Crystal Reports for Eclipse Developer Guide

To create a class that listens to editor open and close events

You can implement a class that listens to editor open and close events. Add initialization code to the editorOpened method and cleanup code to the editorClosed method.
  1. Click File > New > Class
    The" New Java Class" dialog box appears.
  2. Type the name of the class in the <Name> field.
    For example, type MyClass.
  3. Click Add.
    The "Implemented Interfaces Selection" dialog box appears.
  4. Type com.businessobjects.crystalreports.designer.sdk.IEditorOpenedListener and click OK.
  5. Click Finish.
    A class is created that implements the IEditorOpenedListener interface.
  6. Implement the editorOpened method and perfrom initialization.
    public void editorOpened(ICrystalReportsEditor editor)
    {
       System.out.println("editorOpened");
    }
  7. Add an IEditorClosedListener to the editorOpened method.
    public void editorOpened(ICrystalReportsEditor editor)
    {
      IEditorClosedListener closedListener = new IEditorClosedListener()
      {
        public void editorClosed(ICrystalReportsEditor editor)
        {
          System.out.println("editorClosed");
        }
      };
    
      editor.addClosedListener(closedListener);
    }
Example: A editor open and close listener class
import com.businessobjects.crystalreports.designer.sdk.ICrystalReportsEditor;
import com.businessobjects.crystalreports.designer.sdk.IEditorClosedListener;
import com.businessobjects.crystalreports.designer.sdk.IEditorOpenedListener;

public void MyClass implements IEditorOpenedListener
{
  public void editorOpened(ICrystalReportsEditor editor)
  {
    System.out.println("editorOpened");
  }  

  public void editorOpened(ICrystalReportsEditor editor)
  {
    IEditorClosedListener closedListener = new IEditorClosedListener()
    {
      public void editorClosed(ICrystalReportsEditor editor)
      {
        System.out.println("editorClosed");
      }
    };

    editor.addClosedListener(closedListener);
  }
}



SAP BusinessObjects
http://www.sap.com/sapbusinessobjects/
Support services
http://service.sap.com/bosap-support/
Product Documentation on the Web
http://help.sap.com/