org.gjt.sp.jedit
Class EditAction

java.lang.Object
  |
  +--org.gjt.sp.jedit.EditAction
Direct Known Subclasses:
BeanShellAction, Macros.Macro

public abstract class EditAction
extends java.lang.Object

An action.

Instead of subclassing EditAction directly, you should now write an actions.xml file.

Version:
$Id: EditAction.java,v 1.16 2003/02/11 02:31:05 spestov Exp $
Author:
Slava Pestov
See Also:
jEdit.getAction(String), jEdit.getActions(), ActionSet

Nested Class Summary
static class EditAction.Wrapper
          'Wrap' EditActions in this class to turn them into AWT ActionListeners, that can be attached to buttons, menu items, etc.
 
Constructor Summary
EditAction(java.lang.String name)
          Creates a new edit action with the specified name.
 
Method Summary
abstract  java.lang.String getCode()
          Returns the BeanShell code that will replay this action.
 java.lang.String getLabel()
          Returns the action's label.
 java.lang.String getMouseOverText()
          Returns the text that should be shown when the mouse is placed over this action's menu item or tool bar button.
 java.lang.String getName()
          Returns the internal name of this action.
static View getView(java.awt.Component comp)
          Deprecated. Call GUIUtilities.getView() instead.
abstract  void invoke(View view)
          Invokes the action.
 boolean isSelected(View view)
          If this edit action is a toggle, returns if it is selected or not.
 boolean isToggle()
          Returns if this edit action should be displayed as a check box in menus.
 boolean noRecord()
          Returns if this edit action should not be recorded.
 boolean noRepeat()
          Returns if this edit action should not be repeated.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditAction

public EditAction(java.lang.String name)
Creates a new edit action with the specified name.

Parameters:
name - The action name
Method Detail

getName

public java.lang.String getName()
Returns the internal name of this action.


getLabel

public java.lang.String getLabel()
Returns the action's label. The default implementation returns the value of the property named by getName() suffixed with .label.


getMouseOverText

public java.lang.String getMouseOverText()
Returns the text that should be shown when the mouse is placed over this action's menu item or tool bar button. Currently only used by the macro system.

Since:
jEdit 4.0pre5

invoke

public abstract void invoke(View view)
Invokes the action.

Parameters:
view - The view
Since:
jEdit 2.7pre2

getView

public static View getView(java.awt.Component comp)
Deprecated. Call GUIUtilities.getView() instead.


isToggle

public boolean isToggle()
Returns if this edit action should be displayed as a check box in menus.

Since:
jEdit 2.2pre4

isSelected

public boolean isSelected(View view)
If this edit action is a toggle, returns if it is selected or not.

Parameters:
view - The view
Since:
jEdit 3.2pre5

noRepeat

public boolean noRepeat()
Returns if this edit action should not be repeated. Returns false by default.

Since:
jEdit 2.7pre2

noRecord

public boolean noRecord()
Returns if this edit action should not be recorded. Returns false by default.

Since:
jEdit 2.7pre2

getCode

public abstract java.lang.String getCode()
Returns the BeanShell code that will replay this action.

Since:
jEdit 2.7pre2

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object