gnu
Class MenuAction

java.lang.Object
  extended by gnu.MenuAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Direct Known Subclasses:
Beautifier, BoxComment, BoxUncomment, CreateTemplate, InsertClassName, JBrowsePlugin.OpenAction, LeftIndent, Print, RemoveWhitespace, RightIndent, SimpleComment, SimpleUnComment, ToLowerCase, ToUpperCase

public abstract class MenuAction
extends java.lang.Object
implements java.awt.event.ActionListener

This class implements an ActionListener and handles action events fired by . This class also provides two new methods which can be used to get the window which has fired the event and the associated text area.


Field Summary
protected  java.lang.String name
           
 
Constructor Summary
MenuAction(java.lang.String name)
          Creates a new menu action designed by its name.
 
Method Summary
static AbstractEditorPanel getJextParent(java.awt.Component comp)
           
static AbstractEditorPanel getJextParent(java.util.EventObject evt)
          Returns the window which fired the event.
 java.lang.String getName()
          Returns the associated action name.
static AbstractDoc getNSTextArea(java.awt.Component c)
           
static AbstractDoc getNSTextArea(java.util.EventObject evt)
          This methods returns the selected text area in the window which fired the event, excluding the splitted one.
static AbstractDoc getTextArea(java.awt.Component c)
           
static AbstractDoc getTextArea(java.util.EventObject evt)
          This methods returns the selected text area in the window which fired the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

name

protected java.lang.String name
Constructor Detail

MenuAction

public MenuAction(java.lang.String name)
Creates a new menu action designed by its name. This name is internally used by Jext to handles scripts, correctly build menu bar and tool bar.

Parameters:
name - Internal action name
Method Detail

getName

public java.lang.String getName()
Returns the associated action name.


getTextArea

public static AbstractDoc getTextArea(java.util.EventObject evt)
This methods returns the selected text area in the window which fired the event.

Parameters:
evt - The source event

getNSTextArea

public static AbstractDoc getNSTextArea(java.util.EventObject evt)
This methods returns the selected text area in the window which fired the event, excluding the splitted one.

Parameters:
evt - The source event

getJextParent

public static AbstractEditorPanel getJextParent(java.util.EventObject evt)
Returns the window which fired the event.

Parameters:
evt - The source event

getTextArea

public static AbstractDoc getTextArea(java.awt.Component c)

getNSTextArea

public static AbstractDoc getNSTextArea(java.awt.Component c)

getJextParent

public static AbstractEditorPanel getJextParent(java.awt.Component comp)


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.