org.getopt.luke.plugins
Class ScriptingPlugin

java.lang.Object
  extended by org.getopt.luke.LukePlugin
      extended by org.getopt.luke.plugins.ScriptingPlugin

public class ScriptingPlugin
extends LukePlugin

This is a JavaScript interactive shell. All elements of Luke framework are made available to the plugin by putting them into JS Context.

Author:
Andrzej Bialecki <ab@getopt.org>

Field Summary
 
Fields inherited from class org.getopt.luke.LukePlugin
app, dir, ir, myUi
 
Constructor Summary
ScriptingPlugin()
           
 
Method Summary
 void actionHelp(java.lang.Object ta)
           
 void actionSample()
           
 void car(java.lang.Object ta)
           
 void clear()
           
 void execute(java.lang.String cmd)
           
 java.lang.String getPluginHome()
          Return URL to plugin home page or author's e-mail.
 java.lang.String getPluginInfo()
          Return short one-line info about the plugin.
 java.lang.String getPluginName()
          Returns a plugin name.
 java.lang.String getXULName()
          This method should return a fully qualified name/path of the XUL resource used to build the UI for the plugin.
 boolean init()
          Initialize this component.
 void ins(java.lang.Object ta)
           
 void rem(java.lang.Object ta)
           
 void reset()
           
 void setWrap(java.lang.Object cbWrap, java.lang.Object ta)
           
 
Methods inherited from class org.getopt.luke.LukePlugin
getApplication, getDirectory, getIndexReader, getMyUi, setApplication, setDirectory, setIndexReader, setMyUi
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptingPlugin

public ScriptingPlugin()
Method Detail

reset

public void reset()

clear

public void clear()

getXULName

public java.lang.String getXULName()
Description copied from class: LukePlugin
This method should return a fully qualified name/path of the XUL resource used to build the UI for the plugin. The path should follow the rules specified in the ClassLoader documentation fo finding resources.
The top level element for the UI should always be a panel. The size of this panel must NOT be specified, but its "halign", "valign" attributes should be set to "fill", and "weightx", "weighty" attributes set to "1" - then the size of the panel will be determined at runtime and will always fill available space for the plugin UI.

Specified by:
getXULName in class LukePlugin
Returns:
full path to the XUL resource (filename or URL)

getPluginName

public java.lang.String getPluginName()
Description copied from class: LukePlugin
Returns a plugin name. NOTE: this should be a short (preferably one word) String, because it's length affects the amount of available screen space.

Specified by:
getPluginName in class LukePlugin
Returns:
short plugin name

getPluginInfo

public java.lang.String getPluginInfo()
Description copied from class: LukePlugin
Return short one-line info about the plugin.

Specified by:
getPluginInfo in class LukePlugin

getPluginHome

public java.lang.String getPluginHome()
Description copied from class: LukePlugin
Return URL to plugin home page or author's e-mail. NOTE: this MUST be a fully qualified URL, i.e. including the protocol part.

Specified by:
getPluginHome in class LukePlugin

init

public boolean init()
             throws java.lang.Exception
Description copied from class: LukePlugin
Initialize this component. Parent view, this view, directory and index reader should already be initialized.
This method will be called repeatedly, whenever new index is loaded into Luke.

Specified by:
init in class LukePlugin
Returns:
true on success, false on non-catastrophic failure
Throws:
java.lang.Exception - when an unrecoverable error occurs

setWrap

public void setWrap(java.lang.Object cbWrap,
                    java.lang.Object ta)

execute

public void execute(java.lang.String cmd)

ins

public void ins(java.lang.Object ta)

rem

public void rem(java.lang.Object ta)

car

public void car(java.lang.Object ta)

actionHelp

public void actionHelp(java.lang.Object ta)

actionSample

public void actionSample()