projectviewer.action
Class LaunchBrowserAction

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

public class LaunchBrowserAction
extends Action

Opens the selected file in the configured web-browser. Files that are under the project root are treated differently: the project's URL root is used to build the URL. For other files, or if the projects URL is not set, the absolute path to the file is given to the browser.

Version:
$Id: LaunchBrowserAction.java 6344 2005-05-16 07:25:48Z vanza $
Author:
Marcelo Vanzin (based on code from Matthew Payne)

Nested Class Summary
static class LaunchBrowserAction.Helper
          Class to hold references to classes that may not be available, so this class can behave well when called from a BeanShell script.
 
Field Summary
 
Fields inherited from class projectviewer.action.Action
action, cmItem, tbButton, viewer
 
Constructor Summary
LaunchBrowserAction()
          Default constructor.
LaunchBrowserAction(VPTFile file)
          Instantiates a launcher for the given file.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Creates a new project.
 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 the root node.
 
Methods inherited from class projectviewer.action.Action
clone, getButton, getIcon, getMenuItem, setViewer
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaunchBrowserAction

public LaunchBrowserAction()
Default constructor.


LaunchBrowserAction

public LaunchBrowserAction(VPTFile file)
Instantiates a launcher for the given file.

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

actionPerformed

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


prepareForNode

public void prepareForNode(VPTNode node)
Enable action only for the root node.

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