Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-394

super not found

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0
    • None
    • None
    • jdk 1.4.2_03, winxp

    Description

      The following code when executing (via bsf but I guess it shouldn't matter), gives the below error.
      No such method: actionPerformed for class: SomeAction. At [16:24] Bracket_Handler.groovy

      Code in Bracket_Handler.groovy

      import javax.swing.*;
      import java.awt.event.*;
      import org.gjt.sp.jedit.*;
      import org.gjt.sp.jedit.textarea.*;

      public class SomeAction extends javax.swing.text.TextAction
      {
      public SomeAction()

      { super("OpenBracket"); }

      public void actionPerformed(ActionEvent e)

      { System.out.println("Printing " + e.getSource()); super.actionPerformed(e); /* System.out.println("Printing " + e.getSource()); JEditTextArea textArea = (JEditTextArea)e.getSource(); textArea.moveCaretPosition(textArea.getCaretPosition()+); textArea.setSelectedText("}

      "); */
      }
      }

      javax.swing.Action bracket_Action = new SomeAction();
      InputMap inputMap = jEdit.getActiveView().getTextArea().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
      KeyStroke open_bracket = KeyStroke.getKeyStroke("shift OPEN_BRACKET");
      inputMap.put(open_bracket, bracket_Action.getValue(Action.NAME));
      ActionMap actionMap = jEdit.getActiveView().getTextArea().getActionMap();
      actionMap.put(bracket_Action.getValue(Action.NAME), bracket_Action);
      //println "Done";

      Stacktrace in log window
      exception from Groovy: groovy.lang.GroovyRuntimeException: No such method: actionPerformed for class: SomeAction. At [16:24] Bracket_Handler.groovy
      org.apache.bsf.BSFException: exception from Groovy: groovy.lang.GroovyRuntimeException: No such method: actionPerformed for class: SomeAction. At [16:24] Bracket_Handler.groovy
      at org.codehaus.groovy.bsf.GroovyEngine.exec(GroovyEngine.java:167)
      at org.apache.bsf.BSFManager$6.run(Unknown Source)

      -Jiger

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jigerjava Jiger Patel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: