Class Editor

All Implemented Interfaces:
Debugger, MacroConstants, PlugIn, ClipboardOwner, ActionListener, FocusListener, ItemListener, TextListener, WindowListener, ImageObserver, MenuContainer, Serializable, Runnable, EventListener, Accessible

This is a simple TextArea based editor for editing and compiling plugins.
See Also:
  • Field Details

    • JavaScriptIncludes

      public static String JavaScriptIncludes
      ImportPackage statements added in front of scripts. Contains no newlines so that lines numbers in error messages are not changed.
    • MAX_SIZE

      public static final int MAX_SIZE
      See Also:
    • XINC

      public static final int XINC
      See Also:
    • YINC

      public static final int YINC
      See Also:
    • MONOSPACED

      public static final int MONOSPACED
      See Also:
    • MACROS_MENU_ITEMS

      public static final int MACROS_MENU_ITEMS
      See Also:
    • changes

      protected boolean changes
  • Constructor Details

    • Editor

      public Editor()
    • Editor

      public Editor(int rows, int columns, int fontSize, int options)
  • Method Details

    • positionWindow

      public void positionWindow()
    • create

      public void create(String name, String text)
    • createMacro

      public void createMacro(String name, String text)
    • open

      public void open(String dir, String name)
      Opens a file and replaces the text (if any) by the contents of the file.
    • getText

      public String getText()
    • getTextArea

      public TextArea getTextArea()
    • display

      public void display(String title, String text)
    • evaluateScript

      public void evaluateScript(String ext)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • showMacroFunctions

      protected void showMacroFunctions()
    • textValueChanged

      public void textValueChanged(TextEvent e)
      Specified by:
      textValueChanged in interface TextListener
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • windowActivated

      public void windowActivated(WindowEvent e)
      Override windowActivated in PlugInFrame to prevent Mac menu bar from being installed.
      Specified by:
      windowActivated in interface WindowListener
      Overrides:
      windowActivated in class PlugInFrame
    • close

      public void close()
      Overrides close() in PlugInFrame.
      Overrides:
      close in class PlugInFrame
    • saveAs

      public void saveAs()
    • revert

      protected void revert()
    • updateClassName

      public void updateClassName(String oldName, String newName)
      Changes a plugins class name to reflect a new file name.
    • setFont

      public void setFont(Font font)
      Overrides:
      setFont in class Container
    • append

      public void append(String s)
    • setIsMacroWindow

      public void setIsMacroWindow(boolean mw)
    • setDefaultDirectory

      public static void setDefaultDirectory(String defaultDirectory)
    • lostOwnership

      public void lostOwnership(Clipboard clip, Transferable cont)
      Specified by:
      lostOwnership in interface ClipboardOwner
    • debug

      public int debug(Interpreter interp, int mode)
      Specified by:
      debug in interface Debugger
    • getInstance

      public static Editor getInstance()
    • getJSPrefix

      public static String getJSPrefix(String arg)
    • fixLineEndings

      public void fixLineEndings()
      Changes Mac OS 9 (CR) and Windows (CRLF) line separators to line feeds (LF).
    • showLogWindow

      public void showLogWindow()
    • fileChanged

      public boolean fileChanged()
    • run

      public void run()
      Downloads BeanShell or Jython interpreter using a separate thread.
      Specified by:
      run in interface Runnable