org.acm.seguin.ide.jedit.action
Class Action

java.lang.Object
  extended by org.acm.seguin.ide.jedit.action.Action
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
HideAction, JEditUndoAction, ReloadAction, ReloadAllAction, ShowAction

public abstract class Action
extends java.lang.Object
implements java.awt.event.ActionListener, java.lang.Cloneable

An action defines an action to be taken when the user presses some menu item in the tree's context menu or a button on the toolbar.

Since:
0.0.1
Version:
$Id: Action.java,v 1.1 2003/09/17 19:52:50 mikeatkinson Exp $
Author:
Mike Atkinson

Field Summary
protected  javax.swing.JComponent cmItem
          Description of the Field
protected  RolloverButton tbButton
          Description of the Field
protected  JRefactory viewer
          Description of the Field
 
Constructor Summary
Action()
           
 
Method Summary
 java.lang.Object clone()
          Clones the current action, returning a copy of it.
 RolloverButton getButton()
          Returns the toolbar button that triggers this action.
 javax.swing.Icon getIcon()
          Returns the icon to be shown on the toolbar button.
 javax.swing.JComponent getMenuItem()
          Returns the menu item that triggers this action.
abstract  java.lang.String getText()
          Returns a String that will be shown as the text of the menu item or the tooltip of the toolbar button.
 void setViewer(JRefactory viewer)
          Sets the viewer where this action is being used.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

viewer

protected JRefactory viewer
Description of the Field


tbButton

protected RolloverButton tbButton
Description of the Field


cmItem

protected javax.swing.JComponent cmItem
Description of the Field

Constructor Detail

Action

public Action()
Method Detail

getText

public abstract java.lang.String getText()
Returns a String that will be shown as the text of the menu item or the tooltip of the toolbar button.

Returns:
The text value

getIcon

public javax.swing.Icon getIcon()
Returns the icon to be shown on the toolbar button. The default implementation returns "null" so that actions that will only be used in the context menu don't need to implement this.

Returns:
The icon value

getMenuItem

public javax.swing.JComponent getMenuItem()
Returns the menu item that triggers this action. This returns a JComponent, which makes it possible to add virtually anything to the menu. For example, it's possible to return a sub-menu instead of a simple menu item. The default implementation returns a menu item, which is stored in the "cmItem" variable.

Returns:
The menuItem value

getButton

public RolloverButton getButton()
Returns the toolbar button that triggers this action.

Returns:
The button value

clone

public java.lang.Object clone()
Clones the current action, returning a copy of it.

Overrides:
clone in class java.lang.Object
Returns:
Description of the Return Value

setViewer

public void setViewer(JRefactory viewer)
Sets the viewer where this action is being used.

Parameters:
viewer - The new viewer value