com.usefullittlethings.saw.model
Interface ActionPluginIfc

All Superinterfaces:
PluginIfc
All Known Implementing Classes:
AbstractActionPlugin, Compress, Copy, Delete, ListToConsole, Move, ReplaceText, Sawj2h, WriteToFile

public interface ActionPluginIfc
extends PluginIfc

Interface for action plug-ins. Action plug-ins perform some operation on or using the items in the result list. Implementing this interface allows the plug-in to be dynamically loaded by the Search and Whatever application. Plug-ins will be loaded with the SearchController they correspond to, as determined by the values returned by the getResultClass method. For more information on developing plug-ins, refer to the Search and Whatever home page, [Developers] link.

See Also:
PluginIfc.getResultClass()

Field Summary
static java.lang.String CLASS_NAME
           
 
Fields inherited from interface com.usefullittlethings.saw.model.PluginIfc
BLOCK, LINEAR, SINGLE_BLOCK, UNSUPPORTED
 
Method Summary
 void begin()
          This method of the plug-in will be invoked immediately before a search is performed, allowing the plug-in the "prepare" itself to perform a search.
 void end()
          This method of the plug-in will be invoked immediately after a search has completed, allowing the plug-in the perform any post-search clean-up activities..
 void handle(int pattern, java.lang.Object target)
          This method is called by the core application to invoke the plug-in's action.
 boolean isDangerous()
          Returns true or false indicating whether or not the use of this action could be considered dangerous to the user's resources.
 void setBase(java.lang.Object base)
          This method is invoked by the core application to set the search base for the current search operation.
 
Methods inherited from interface com.usefullittlethings.saw.model.PluginIfc
addObserver, clone, configure, configure, deleteObserver, getAuthor, getEmail, getName, getResultClass, getShortName, getState, getUI, getUnixName, getWebsite, hasUI, isEnabled, reset, setEnabled, supportCommandLine, supports, toXMLString
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Method Detail

setBase

public void setBase(java.lang.Object base)
This method is invoked by the core application to set the search base for the current search operation. The object type is determined by the related SearchControllerIfc instance. For example, the File Edition passes a File object representing the root folder for the search.

Parameters:
base - An object representing the search base. The object class is determined by the related SearchControllerIfc instance.

handle

public void handle(int pattern,
                   java.lang.Object target)
            throws ActionInvocationException
This method is called by the core application to invoke the plug-in's action. The pattern parameter defines the type of search pattern that is be used (see PluginIfc). The target paramter is the object that the action plug-in should perform its operation on. The target may be an object, an object array, or any object instance. The class type should be defined in the search controller's API reference. For example, the File Edition will pass in a File or a File[] object depending on the search pattern.

Parameters:
pattern - A constant from PluginIfc representing the type of search pattern that is being performed.
target - The target object to be acted upon.
ActionInvocationException
See Also:
PluginIfc.LINEAR, PluginIfc.BLOCK, PluginIfc.SINGLE_BLOCK

begin

public void begin()
           throws ActionInvocationException
This method of the plug-in will be invoked immediately before a search is performed, allowing the plug-in the "prepare" itself to perform a search.

ActionInvocationException

end

public void end()
         throws ActionInvocationException
This method of the plug-in will be invoked immediately after a search has completed, allowing the plug-in the perform any post-search clean-up activities..

ActionInvocationException

isDangerous

public boolean isDangerous()
Returns true or false indicating whether or not the use of this action could be considered dangerous to the user's resources. For example, the plug-in that deletes files would be considered dangerous.