projectviewer.action
Class OpenWithEncodingAction

java.lang.Object
  extended byprojectviewer.action.Action
      extended byprojectviewer.action.OpenWithEncodingAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener

public class OpenWithEncodingAction
extends Action

Opens a node in jEdit using a specific character encoding. The list of encodings is provided by jEdit's MiscUtilities class, so this action will only be available in jEdit 4.2pre5 and later.

Version:
$Id: OpenWithEncodingAction.java 7182 2006-10-07 02:52:51Z vanza $
Author:
Marcelo Vanzin

Field Summary
 
Fields inherited from class projectviewer.action.Action
action, cmItem, tbButton, viewer
 
Constructor Summary
OpenWithEncodingAction()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Creates a new project.
 javax.swing.JComponent getMenuItem()
          Returns the menu item that triggers this action.
 java.lang.String getText()
          Returns the text to be shown on the button and/or menu item.
 void prepareForNode(VPTNode node)
          Enable action only for openable nodes.
 
Methods inherited from class projectviewer.action.Action
clone, getButton, getIcon, setViewer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenWithEncodingAction

public OpenWithEncodingAction()
Method Detail

getText

public java.lang.String getText()
Returns the text to be shown on the button and/or menu item.

Specified by:
getText in class Action

getMenuItem

public javax.swing.JComponent getMenuItem()
Description copied from class: Action
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.

Overrides:
getMenuItem in class Action

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Creates a new project.


prepareForNode

public void prepareForNode(VPTNode node)
Enable action only for openable nodes.

Overrides:
prepareForNode in class Action
Parameters:
node - The selected node, or "null" if multiple nodes are selected.