org.getopt.luke.plugins
Class SimilarityDesignerPlugin

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

public class SimilarityDesignerPlugin
extends LukePlugin

This plugin lets you write your own implementation of Similarity using JavaScript and Mozilla Rhino engine.

The script needs to provide functions with specific signatures. These functions are then executed by a CustomSimilarity facade class.

Author:
Andrzej Bialecki <ab@getopt.org>

Field Summary
 
Fields inherited from class org.getopt.luke.LukePlugin
app, dir, ir, myUi
 
Constructor Summary
SimilarityDesignerPlugin()
          Default constructor.
 
Method Summary
 void actionCompileSimilarity()
           
 void actionLoadSample(java.lang.Object menu)
           
 void actionNew()
           
 void actionOpenFile()
           
 void actionSaveFile()
           
 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 invalidate()
           
 
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

SimilarityDesignerPlugin

public SimilarityDesignerPlugin()
                         throws java.lang.Exception
Default constructor.

Throws:
java.lang.Exception
Method Detail

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

actionLoadSample

public void actionLoadSample(java.lang.Object menu)

actionNew

public void actionNew()

invalidate

public void invalidate()

actionCompileSimilarity

public void actionCompileSimilarity()

actionSaveFile

public void actionSaveFile()

actionOpenFile

public void actionOpenFile()