OME
Interface PluginMethod

All Known Implementing Classes:
AbstractPluginMethod

public interface PluginMethod

See Also:
AbstractPluginMethod

Method Summary
 void cancelled()
          Indicates that user has aborted the method during the parameter collection phase (typically through the ESCAPE key).
 java.awt.Image getImage()
          The image to be associated with this method.
 java.lang.String getName()
          The name to be used for listing in menus and tooltips etc...
 java.util.Collection getSubmenu()
          If the purpose of this method is to provide access to a set of other methods (like a menu), return those other methods.
 java.util.Collection getSubmenu(ViewContext ovc)
          If the purpose of this method is to provide access to a set of other methods (like a menu), return those other methods.
 void invoke()
          This method is called by the view after it has been notified by nextParameter() that there are no more parameters to be collected.
 boolean isEnabled(ViewContext con)
          Returns whether this method should be enabled or not, given the view context.
 PluginParameter nextParameter()
          Returns a PluginParameter that specifies the type of parameter the method wants next OR if the method doesn't want any more parameters returns null.
 void passParameter(java.util.Collection parameter)
          The View will call this routine to pass the parameter requested by the return value of the last call to nextParameter().
 

Method Detail

invoke

public void invoke()
This method is called by the view after it has been notified by nextParameter() that there are no more parameters to be collected.

getName

public java.lang.String getName()
The name to be used for listing in menus and tooltips etc...

getImage

public java.awt.Image getImage()
The image to be associated with this method.

getSubmenu

public java.util.Collection getSubmenu(ViewContext ovc)
If the purpose of this method is to provide access to a set of other methods (like a menu), return those other methods. If that is not the purpose of this method, it should return null. The ViewContext is provided so the menu may be dynamically populated.
Parameters:
ovc - the view context for which we want the submenu

getSubmenu

public java.util.Collection getSubmenu()
If the purpose of this method is to provide access to a set of other methods (like a menu), return those other methods. If that is not the purpose of this method, it should return null. The toolbar is not aware of context when it is created so we must support a context-less submenu query...

nextParameter

public PluginParameter nextParameter()
Returns a PluginParameter that specifies the type of parameter the method wants next OR if the method doesn't want any more parameters returns null.

The parameter requesting a location will return the location where the Popup Menu was opened if this method was attached to the Popup Menu.


passParameter

public void passParameter(java.util.Collection parameter)
The View will call this routine to pass the parameter requested by the return value of the last call to nextParameter().
Parameters:
parameter - the parameter to be passed to the PluginMethod. Note: This parameter is passed as a singleton collection.

cancelled

public void cancelled()
Indicates that user has aborted the method during the parameter collection phase (typically through the ESCAPE key). The method should clean itself up at this point, as invoke will not be called.

isEnabled

public boolean isEnabled(ViewContext con)
Returns whether this method should be enabled or not, given the view context.
Parameters:
con - the view context to decide whether this method should be enabled or not.