Module ij

Class Editor

  • All Implemented Interfaces:
    Debugger, MacroConstants, PlugIn, java.awt.datatransfer.ClipboardOwner, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.TextListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible

    public class Editor
    extends PlugInFrame
    implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.TextListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.datatransfer.ClipboardOwner, MacroConstants, java.lang.Runnable, Debugger
    This is a simple TextArea based editor for editing and compiling plugins.
    See Also:
    Serialized Form
    • Constructor Detail

      • Editor

        public Editor()
      • Editor

        public Editor​(java.lang.String name)
      • Editor

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

      • positionWindow

        public void positionWindow()
      • create

        public void create​(java.lang.String name,
                           java.lang.String text)
      • createMacro

        public void createMacro​(java.lang.String name,
                                java.lang.String text)
      • setRejectMacrosMsg

        public void setRejectMacrosMsg​(java.lang.String msg)
      • getRejectMacrosMsg

        public java.lang.String getRejectMacrosMsg()
      • open

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

        public java.lang.String getText()
      • getTextArea

        public java.awt.TextArea getTextArea()
      • display

        public void display​(java.lang.String title,
                            java.lang.String text)
      • evaluateScript

        public void evaluateScript​(java.lang.String ext)
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • openExample

        public static boolean openExample​(java.lang.String name)
        Opens an example from the Help/Examples menu and runs if "Autorun Exampes" is checked.
      • showMacroFunctions

        protected void showMacroFunctions()
      • textValueChanged

        public void textValueChanged​(java.awt.event.TextEvent e)
        Specified by:
        textValueChanged in interface java.awt.event.TextListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent e)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent e)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • insertText

        public void insertText​(java.lang.String text)
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent e)
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent e)
        Override windowActivated in PlugInFrame to prevent Mac menu bar from being installed.
        Specified by:
        windowActivated in interface java.awt.event.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​(java.lang.String oldName,
                                    java.lang.String newName)
        Changes a plugins class name to reflect a new file name.
      • setFont

        public void setFont​(java.awt.Font font)
        Overrides:
        setFont in class java.awt.Container
      • getFontSize

        public int getFontSize()
      • append

        public void append​(java.lang.String s)
      • setIsMacroWindow

        public void setIsMacroWindow​(boolean mw)
      • setDefaultDirectory

        public static void setDefaultDirectory​(java.lang.String dir)
      • lostOwnership

        public void lostOwnership​(java.awt.datatransfer.Clipboard clip,
                                  java.awt.datatransfer.Transferable cont)
        Specified by:
        lostOwnership in interface java.awt.datatransfer.ClipboardOwner
      • getInstance

        public static Editor getInstance()
      • getJSPrefix

        public static java.lang.String getJSPrefix​(java.lang.String arg)
      • fixLineEndings

        public void fixLineEndings()
        Changes 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 java.lang.Runnable