edu.umd.cfar.lamp.viper.gui.plugins
Class ScriptManager

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.gui.plugins.ScriptManager
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ScriptManager
extends java.lang.Object
implements java.awt.event.ActionListener

Searches the 'script' directory for files to run and adds them to the script menu. It also watches the 'script' directory for changes.


Constructor Summary
ScriptManager()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Runs the script found specified in the action command string.
 ViperViewMediator getMediator()
          Gets the viper UI mediator the script manager should link with.
 com.hp.hpl.jena.rdf.model.Resource getParentResource()
          Gets the URI that this bean is attached to.
 javax.swing.Action getResetAction()
           
 void resetScriptMenu()
          Reloads the script menu from the file system.
 void setMediator(ViperViewMediator mediator)
          Sets the viper UI mediator the script manager should link with.
 void setParentResource(com.hp.hpl.jena.rdf.model.Resource parentResource)
          Sets the URI that this bean is attached to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptManager

public ScriptManager()
Method Detail

getMediator

public ViperViewMediator getMediator()
Gets the viper UI mediator the script manager should link with.

Returns:
the associated UI mediator, or null if none is set

setMediator

public void setMediator(ViperViewMediator mediator)
Sets the viper UI mediator the script manager should link with. TODO-davidm: add an event listener to get changes to the location of scripts FIXME-davidm: add a timer loop that checks for new scripts

Parameters:
mediator - the UI mediator

resetScriptMenu

public void resetScriptMenu()
Reloads the script menu from the file system.


getParentResource

public com.hp.hpl.jena.rdf.model.Resource getParentResource()
Gets the URI that this bean is attached to.

Returns:
the URI of the container

setParentResource

public void setParentResource(com.hp.hpl.jena.rdf.model.Resource parentResource)
Sets the URI that this bean is attached to. This is the bean where menu items will be attached.

Parameters:
parentResource - the URI of the container

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Runs the script found specified in the action command string.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the action event object

getResetAction

public javax.swing.Action getResetAction()