ij.plugin.frame
Class Editor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by ij.plugin.frame.PlugInFrame
                          extended by ij.plugin.frame.Editor
All Implemented Interfaces:
MacroConstants, KeyCode, PlugIn, java.awt.datatransfer.ClipboardOwner, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CaretListener, javax.swing.event.DocumentListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Editor
extends PlugInFrame
implements PlugIn, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.KeyListener, javax.swing.event.DocumentListener, javax.swing.event.CaretListener, MacroConstants, KeyCode, java.awt.datatransfer.ClipboardOwner

This is a simple TextArea based editor for editing and compiling plugins.

See Also:
Serialized Form

Nested Class Summary
 class Editor.JEditor
           
 class Editor.JSyntaxStyleTree
           
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String abortmacroAction
           
static java.lang.String actionSuffix
          Suffix applied to the key used in resource file lookups for an action.
static java.lang.String compileandrunAction
           
static java.lang.String copyAction
           
static java.lang.String cutAction
           
static java.lang.String deleteAction
           
static java.lang.String editAction
           
static java.lang.String evaluatelineAction
           
static java.lang.String exitAction
           
static java.lang.String findAction
           
static java.lang.String findnextAction
           
static Editor focusedComponent
           
static java.lang.String gotobeginlineAction
           
static java.lang.String gotoendlineAction
           
static java.lang.String gotolineAction
           
static java.lang.String imageSuffix
          Suffix applied to the key used in resource file lookups for an image.
static java.lang.String installmacrosAction
           
static java.lang.String JavaScriptIncludes
          ImportPackage statements added in front of scripts.
static java.lang.String JS_NOT_FOUND
           
static java.lang.String labelSuffix
          Suffix applied to the key used in resource file lookups for a label.
static java.lang.String largerAction
           
static int MACROS_MENU_ITEMS
           
static int MAX_MACROS
           
static int MAX_SIZE
           
static int MENU_BAR
           
static int MONOSPACED
           
static java.lang.String monospacedAction
           
static java.lang.String newAction
           
static java.lang.String nonSelectAction
           
static java.lang.String openAction
           
static java.lang.String pasteAction
           
static java.lang.String printAction
           
 int row
           
static java.lang.String runappAction
           
static java.lang.String runmacroAction
           
static java.lang.String saveAction
           
static java.lang.String saveAsAction
           
static java.lang.String savesettingsAction
           
static java.lang.String selectAllAction
           
static java.lang.String smalerAction
           
static java.lang.String tipSuffix
          Suffix applied to the key used in resource file lookups for tooltip text.
protected  javax.swing.undo.UndoManager undo
          UndoManager that we add edits to.
protected  javax.swing.event.UndoableEditListener undoHandler
          Listener for the edits on the current document.
static java.lang.String undoSuffix
          Suffix applied to the key used in resource file lookups for an button enabled.
static int XINC
           
static int YINC
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ij.macro.MacroConstants
ABS, ACOS, ARRAY, ARRAY_FUNC, ARRAY_FUNCTION, arrayFunctionIDs, arrayFunctions, ASIN, ATAN, ATAN2, AUTO_UPDATE, BEEP, BIT_DEPTH, CALCULATOR, CALIBRATE, CALL, CHANGE_VALUES, CHAR_CODE_AT, CLOSE, COS, D2S, DEBUG, DIALOG, DIV_EQUAL, DO, DO_COMMAND, DO_WAND, DRAW_LINE, DRAW_OVAL, DRAW_RECT, DRAW_STRING, DUMP, ELSE, ENDS_WITH, EOF, EQ, EVAL, EXEC, EXIT, EXP, EXT, FALSE, FILE, FILL, FILL_OVAL, FILL_RECT, FIT, FLOOD_FILL, FLOOR, FOR, FROM_CHAR_CODE, FUNCTION, functionIDs, functions, GET_ARGUMENT, GET_BOOLEAN, GET_BOUNDING_RECT, GET_BOUNDS, GET_COORDINATES, GET_COUNT, GET_CURSOR_LOC, GET_DATE_AND_TIME, GET_DIMENSIONS, GET_DIRECTORY, GET_DISPLAYED_AREA, GET_FILE_LIST, GET_FONT_LIST, GET_HEIGHT, GET_HISTOGRAM, GET_ID, GET_IMAGE_INFO, GET_INFO, GET_LINE, GET_LIST, GET_LOCATION_AND_SIZE, GET_LUT, GET_METADATA, GET_MIN_AND_MAX, GET_NUMBER, GET_PIXEL, GET_PIXEL_SIZE, GET_PROFILE, GET_RAW_STATISTICS, GET_RESULT, GET_RESULT_LABEL, GET_SLICE_NUMBER, GET_STATISTICS, GET_STRING, GET_STRING_WIDTH, GET_THRESHOLD, GET_TIME, GET_TITLE, GET_VALUE, GET_VERSION, GET_VOXEL_SIZE, GET_WIDTH, GET_ZOOM, GT, GTE, IF, IJ_CALL, INDEX_OF, INVERT, IS, IS_ACTIVE, IS_KEY_DOWN, IS_NAN, IS_OPEN, keywordIDs, keywords, LAST_INDEX_OF, LENGTH_OF, LINE_TO, LIST, LOG, LOGICAL_AND, LOGICAL_OR, LT, LTE, MACRO, MAKE_ELLIPSE, MAKE_LINE, MAKE_OVAL, MAKE_POINT, MAKE_POLYGON, MAKE_RECTANGLE, MAKE_SELECTION, MAKE_TEXT, MATCHES, MAX_OF, MIN_OF, MINUS_EQUAL, MINUS_MINUS, MOVE_TO, MUL_EQUAL, NaN, NEQ, NEW_ARRAY, NEW_IMAGE, NEW_MENU, NIMAGES, NOP, NRESULTS, NSLICES, NUMBER, NUMERIC_FUNCTION, numericFunctionIDs, numericFunctions, OPEN, OVERLAY, PARSE_FLOAT, PARSE_INT, PI, PLOT, PLUS_EQUAL, PLUS_PLUS, POW, PREDEFINED_FUNCTION, PRINT, PUT_PIXEL, RANDOM, RENAME, REPLACE, REQUIRES, RESET, RESET_MIN_MAX, RESET_THRESHOLD, RESTORE_PREVIOUS_TOOL, RESTORE_SETTINGS, RETURN, ROI_MANAGER, ROUND, RUN, RUN_MACRO, SAVE, SAVE_AS, SAVE_SETTINGS, SCREEN_HEIGHT, SCREEN_WIDTH, SELECT, SELECT_IMAGE, SELECTION_CONTAINS, SELECTION_NAME, SELECTION_TYPE, SET_AUTO_THRESHOLD, SET_BACKGROUND, SET_BATCH_MODE, SET_COLOR, SET_FONT, SET_FOREGROUND, SET_JUSTIFICATION, SET_KEY_DOWN, SET_LINE_WIDTH, SET_LOCATION, SET_LUT, SET_METADATA, SET_MIN_MAX, SET_OPTION, SET_PASTE_MODE, SET_PIXEL, SET_RESULT, SET_RGB_WEIGHTS, SET_SELECTION_LOC, SET_SELECTION_NAME, SET_SLICE, SET_THRESHOLD, SET_TOOL, SET_VOXEL_SIZE, SET_Z_COORDINATE, SETUP_UNDO, SHIFT_LEFT, SHIFT_RIGHT, SHOW_MESSAGE, SHOW_MESSAGE_WITH_CANCEL, SHOW_PROGRESS, SHOW_STATUS, SHOW_TEXT, SIN, SNAPSHOT, SPLIT, SQRT, STACK, STARTS_WITH, STRING, STRING_CONSTANT, STRING_FUNCTION, stringFunctionIDs, stringFunctions, SUBSTRING, TAN, TO_BINARY, TO_HEX, TO_LOWER_CASE, TO_STRING, TO_UPPER_CASE, TOK_MASK, TOK_SHIFT, TOOL_ID, TRUE, UPDATE_DISPLAY, UPDATE_RESULTS, USER_FUNCTION, VAR, WAIT, WAIT_FOR_USER, WHILE, WORD, WRITE
 
Fields inherited from interface ij.plugin.frame.KeyCode
shortcutKeyi, shortcutKeys
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Editor()
           
 
Method Summary
static void addMode(Mode mode)
          Do not call this method.
 void addOpenRecentDefaultItem(javax.swing.JMenu recentMenu, int count)
           
 void addOpenRecentItem(java.lang.String path)
          Adds a file path to the beginning of the File/Open Recent submenu.
 void caretUpdate(javax.swing.event.CaretEvent e)
          Override caret listener method
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 void checkBox_itemStateChanged(java.awt.event.ItemEvent e)
           
 void close()
          Overrides close() in PlugInFrame.
 void create(java.lang.String name, java.lang.String text)
           
protected  java.beans.PropertyChangeListener createActionChangeListener(javax.swing.AbstractButton b)
           
protected  javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String cmd)
          This is the hook through which all menu items are created.
protected  javax.swing.JComponent createEditor()
          Create an editor to represent the given document.
 void createMacro(java.lang.String name, java.lang.String text)
           
protected  javax.swing.JMenu createMenu(java.lang.String key)
          Create a menu for the app.
protected  javax.swing.JMenuBar createMenubar()
          Create the menubar for the app.
protected  javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
          This is the hook through which all menu items are created.
protected  javax.swing.JMenuItem createMenuItem(java.lang.String cmd, int shortcut, boolean shift)
          This is the hook through which all menu items are created.
protected  javax.swing.text.JTextComponent createMessagesEditor()
          Create an editor to represent the given document.
protected  javax.swing.JPanel createStatusBar(javax.swing.JLabel label)
          Create a status bar
protected  java.awt.Component createTool(java.lang.String key, boolean isbutton)
          Hook through which every toolbar item is created.
protected  java.awt.Component createToolbarButton(java.lang.String key, boolean isbutton)
          Create a button to go inside of the toolbar.
static void display(java.lang.String title, java.lang.String text, java.lang.String fileName)
           
 boolean fileChanged()
           
 void findCaretPos()
           
protected  javax.swing.Action getAction(java.lang.String cmd)
          Fetch the list of actions supported by this editor.
 int getDocLength()
           
protected  JEditTextArea getEditor()
          Fetch the editor contained in this panel
 java.awt.Insets getInsets()
          Override Container getInsets() to make room for some text above the image.
static Editor getInstance()
           
static java.lang.String getJSPrefix(java.lang.String arg)
           
protected  javax.swing.JMenuBar getMenubar()
           
protected  javax.swing.JMenuItem getMenuItem(java.lang.String cmd)
          Fetch the menu item that was created for the given command.
static Mode getMode(java.lang.String name)
          Returns the edit mode with the specified name.
static Mode[] getModes()
          Returns an array of installed edit modes.
static java.util.Properties getProperties()
          Returns the properties object which contains all known jEdit properties.
static java.lang.String getProperty(java.lang.String name)
          Fetches a property, returning null if it's not defined.
static java.lang.String getProperty(java.lang.String name, java.lang.Object[] args)
          Returns the property with the specified name.
static java.lang.String getProperty(java.lang.String name, java.lang.String def)
          Fetches a property, returning the default value if it's not defined.
protected  java.net.URL getResource(java.lang.String key)
           
protected  java.lang.String getResourceString(java.lang.String nm)
           
 java.lang.String getText()
           
protected  java.awt.Container getToolbar()
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void keyPressed(java.awt.event.KeyEvent e)
          Override key listener methods
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
static void loadMode(Mode mode)
           
 void lostOwnership(java.awt.datatransfer.Clipboard clip, java.awt.datatransfer.Transferable cont)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          Override mouse motionlistener methods
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
          Override mouse listener methods
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
          Override mouse wheellistener method
 void open(java.lang.String dir, java.lang.String fileName)
           
 void paint(java.awt.Graphics g)
           
 void positionWindow()
           
static void reloadModes()
          Reloads all edit modes.
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
protected  void resetUndoManager()
          Resets the undo manager.
 void run()
           
 void run(java.lang.String arg)
          This method is called when the plugin is loaded.
 boolean saveChangesDialog()
           
static void savePreferences(java.util.Properties prefs)
          Called once when ImageJ quits.
static void setDefaultDirectory(java.lang.String defaultDirectory)
           
 void setFont(java.awt.Font font)
           
 void setIsMacroWindow(boolean mw)
           
protected  java.lang.String[] tokenize(java.lang.String input)
          Take the given string and chop it up into a series of strings on whitespace boundaries.
 void update(java.awt.Graphics g)
           
 void updateClassName(java.lang.String oldName, java.lang.String newName)
          Changes a plugins class name to reflect a new file name.
 void windowActivated(java.awt.event.WindowEvent e)
          Override windowActivated in PlugInFrame to prevent Mac menu bar from being installed.
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class ij.plugin.frame.PlugInFrame
focusGained, focusLost
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

JavaScriptIncludes

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


JS_NOT_FOUND

public static java.lang.String JS_NOT_FOUND

MAX_SIZE

public static final int MAX_SIZE
See Also:
Constant Field Values

MAX_MACROS

public static final int MAX_MACROS
See Also:
Constant Field Values

XINC

public static final int XINC
See Also:
Constant Field Values

YINC

public static final int YINC
See Also:
Constant Field Values

MONOSPACED

public static final int MONOSPACED
See Also:
Constant Field Values

MENU_BAR

public static final int MENU_BAR
See Also:
Constant Field Values

MACROS_MENU_ITEMS

public static final int MACROS_MENU_ITEMS
See Also:
Constant Field Values

row

public int row

focusedComponent

public static Editor focusedComponent

undoSuffix

public static final java.lang.String undoSuffix
Suffix applied to the key used in resource file lookups for an button enabled.

See Also:
Constant Field Values

imageSuffix

public static final java.lang.String imageSuffix
Suffix applied to the key used in resource file lookups for an image.

See Also:
Constant Field Values

labelSuffix

public static final java.lang.String labelSuffix
Suffix applied to the key used in resource file lookups for a label.

See Also:
Constant Field Values

actionSuffix

public static final java.lang.String actionSuffix
Suffix applied to the key used in resource file lookups for an action.

See Also:
Constant Field Values

tipSuffix

public static final java.lang.String tipSuffix
Suffix applied to the key used in resource file lookups for tooltip text.

See Also:
Constant Field Values

cutAction

public static final java.lang.String cutAction
See Also:
Constant Field Values

copyAction

public static final java.lang.String copyAction
See Also:
Constant Field Values

pasteAction

public static final java.lang.String pasteAction
See Also:
Constant Field Values

deleteAction

public static final java.lang.String deleteAction
See Also:
Constant Field Values

editAction

public static final java.lang.String editAction
See Also:
Constant Field Values

selectAllAction

public static final java.lang.String selectAllAction
See Also:
Constant Field Values

nonSelectAction

public static final java.lang.String nonSelectAction
See Also:
Constant Field Values

openAction

public static final java.lang.String openAction
See Also:
Constant Field Values

newAction

public static final java.lang.String newAction
See Also:
Constant Field Values

saveAction

public static final java.lang.String saveAction
See Also:
Constant Field Values

saveAsAction

public static final java.lang.String saveAsAction
See Also:
Constant Field Values

findAction

public static final java.lang.String findAction
See Also:
Constant Field Values

findnextAction

public static final java.lang.String findnextAction
See Also:
Constant Field Values

gotobeginlineAction

public static final java.lang.String gotobeginlineAction
See Also:
Constant Field Values

gotoendlineAction

public static final java.lang.String gotoendlineAction
See Also:
Constant Field Values

gotolineAction

public static final java.lang.String gotolineAction
See Also:
Constant Field Values

compileandrunAction

public static final java.lang.String compileandrunAction
See Also:
Constant Field Values

runappAction

public static final java.lang.String runappAction
See Also:
Constant Field Values

printAction

public static final java.lang.String printAction
See Also:
Constant Field Values

exitAction

public static final java.lang.String exitAction
See Also:
Constant Field Values

savesettingsAction

public static final java.lang.String savesettingsAction
See Also:
Constant Field Values

monospacedAction

public static final java.lang.String monospacedAction
See Also:
Constant Field Values

smalerAction

public static final java.lang.String smalerAction
See Also:
Constant Field Values

largerAction

public static final java.lang.String largerAction
See Also:
Constant Field Values

runmacroAction

public static final java.lang.String runmacroAction
See Also:
Constant Field Values

evaluatelineAction

public static final java.lang.String evaluatelineAction
See Also:
Constant Field Values

abortmacroAction

public static final java.lang.String abortmacroAction
See Also:
Constant Field Values

installmacrosAction

public static final java.lang.String installmacrosAction
See Also:
Constant Field Values

undoHandler

protected javax.swing.event.UndoableEditListener undoHandler
Listener for the edits on the current document.


undo

protected javax.swing.undo.UndoManager undo
UndoManager that we add edits to.

Constructor Detail

Editor

public Editor()
Method Detail

run

public void run(java.lang.String arg)
Description copied from interface: PlugIn
This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.

Specified by:
run in interface PlugIn
Overrides:
run in class PlugInFrame

run

public void run()

createMessagesEditor

protected javax.swing.text.JTextComponent createMessagesEditor()
Create an editor to represent the given document.


createEditor

protected javax.swing.JComponent createEditor()
Create an editor to represent the given document.


getInsets

public java.awt.Insets getInsets()
Override Container getInsets() to make room for some text above the image.

Overrides:
getInsets in class java.awt.Container

getEditor

protected JEditTextArea getEditor()
Fetch the editor contained in this panel


getAction

protected javax.swing.Action getAction(java.lang.String cmd)
Fetch the list of actions supported by this editor. It is implemented to return the list of actions supported by the embedded JTextComponent augmented with the actions defined locally.


getResourceString

protected java.lang.String getResourceString(java.lang.String nm)

createStatusBar

protected javax.swing.JPanel createStatusBar(javax.swing.JLabel label)
Create a status bar


getToolbar

protected java.awt.Container getToolbar()

getMenubar

protected javax.swing.JMenuBar getMenubar()

getMenuItem

protected javax.swing.JMenuItem getMenuItem(java.lang.String cmd)
Fetch the menu item that was created for the given command.

Parameters:
cmd - Name of the action.

getResource

protected java.net.URL getResource(java.lang.String key)

tokenize

protected java.lang.String[] tokenize(java.lang.String input)
Take the given string and chop it up into a series of strings on whitespace boundaries. This is useful for trying to get an array of strings out of the resource file.


resetUndoManager

protected void resetUndoManager()
Resets the undo manager.


createTool

protected java.awt.Component createTool(java.lang.String key,
                                        boolean isbutton)
Hook through which every toolbar item is created.


createToolbarButton

protected java.awt.Component createToolbarButton(java.lang.String key,
                                                 boolean isbutton)
Create a button to go inside of the toolbar. By default this will load an image resource. The image filename is relative to the classpath (including the '.' directory if its a part of the classpath), and may either be in a JAR file or a separate file.

Parameters:
key - The key in the resource file to serve as the basis of lookups.

createMenubar

protected javax.swing.JMenuBar createMenubar()
Create the menubar for the app. By default this pulls the definition of the menu from the associated resource file.


createMenu

protected javax.swing.JMenu createMenu(java.lang.String key)
Create a menu for the app. By default this pulls the definition of the menu from the associated resource file.


addOpenRecentItem

public void addOpenRecentItem(java.lang.String path)
Adds a file path to the beginning of the File/Open Recent submenu.


addOpenRecentDefaultItem

public void addOpenRecentDefaultItem(javax.swing.JMenu recentMenu,
                                     int count)

createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().

See Also:
getMenuItem(java.lang.String)

createCheckBoxMenuItem

protected javax.swing.JCheckBoxMenuItem createCheckBoxMenuItem(java.lang.String cmd)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().

See Also:
getMenuItem(java.lang.String)

createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd,
                                               int shortcut,
                                               boolean shift)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().

See Also:
getMenuItem(java.lang.String)

createActionChangeListener

protected java.beans.PropertyChangeListener createActionChangeListener(javax.swing.AbstractButton b)

positionWindow

public void positionWindow()

create

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

findCaretPos

public void findCaretPos()

createMacro

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

open

public void open(java.lang.String dir,
                 java.lang.String fileName)

getText

public java.lang.String getText()

getDocLength

public int getDocLength()

display

public static void display(java.lang.String title,
                           java.lang.String text,
                           java.lang.String fileName)

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

setDefaultDirectory

public static void setDefaultDirectory(java.lang.String defaultDirectory)

checkBox_itemStateChanged

public void checkBox_itemStateChanged(java.awt.event.ItemEvent e)

setIsMacroWindow

public void setIsMacroWindow(boolean mw)

lostOwnership

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

getJSPrefix

public static java.lang.String getJSPrefix(java.lang.String arg)

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

saveChangesDialog

public boolean saveChangesDialog()

fileChanged

public boolean fileChanged()

close

public void close()
Overrides close() in PlugInFrame.

Overrides:
close in class PlugInFrame

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

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener
Overrides:
windowClosing in class PlugInFrame

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener
Overrides:
windowOpened in class PlugInFrame

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener
Overrides:
windowClosed in class PlugInFrame

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener
Overrides:
windowIconified in class PlugInFrame

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Overrides:
windowDeiconified in class PlugInFrame

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Overrides:
windowDeactivated in class PlugInFrame

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Override mouse listener methods

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

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

mouseEntered

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

mouseExited

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

mouseClicked

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Override mouse motionlistener methods

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Override mouse wheellistener method

Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

savePreferences

public static void savePreferences(java.util.Properties prefs)
Called once when ImageJ quits.


keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Override key listener methods

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

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

keyTyped

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

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent e)
Override caret listener method

Specified by:
caretUpdate in interface javax.swing.event.CaretListener

update

public void update(java.awt.Graphics g)
Overrides:
update in class javax.swing.JFrame

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Window

getProperties

public static final java.util.Properties getProperties()
Returns the properties object which contains all known jEdit properties. Note that as of jEdit 4.2pre10, this returns a new collection, not the existing properties instance.

Since:
jEdit 3.1pre4

getProperty

public static final java.lang.String getProperty(java.lang.String name)
Fetches a property, returning null if it's not defined.

Parameters:
name - The property

getProperty

public static final java.lang.String getProperty(java.lang.String name,
                                                 java.lang.String def)
Fetches a property, returning the default value if it's not defined.

Parameters:
name - The property
def - The default value

getProperty

public static final java.lang.String getProperty(java.lang.String name,
                                                 java.lang.Object[] args)
Returns the property with the specified name.

The elements of the args array are substituted into the value of the property in place of strings of the form {n}, where n is an index in the array.

You can find out more about this feature by reading the documentation for the format method of the java.text.MessageFormat class.

Parameters:
name - The property
args - The positional parameters

reloadModes

public static void reloadModes()
Reloads all edit modes.

Since:
jEdit 3.2pre2

addMode

public static void addMode(Mode mode)
Do not call this method. It is only public so that classes in the org.gjt.sp.jedit.syntax package can access it.

Parameters:
mode - The edit mode

getMode

public static Mode getMode(java.lang.String name)
Returns the edit mode with the specified name.

Parameters:
name - The edit mode

getModes

public static Mode[] getModes()
Returns an array of installed edit modes.


loadMode

public static void loadMode(Mode mode)

getInstance

public static Editor getInstance()