org.argouml.moduleloader
Interface ModuleInterface


public interface ModuleInterface

This is the interface that each module needs to implement in order to be loadable into ArgoUML according to the new module loader API.

Since:
0.17.1

Field Summary
static int AUTHOR
          The author of the module.
static int DESCRIPTION
          The description of the module.
static int VERSION
          The version of the module.
 
Method Summary
 boolean disable()
          Method to disable the module.
 boolean enable()
          Method to enable the module.
 String getInfo(int type)
          The info about the module.
 String getName()
          The name of the module.
 

Field Detail

DESCRIPTION

public static final int DESCRIPTION
The description of the module.

See Also:
Constant Field Values

AUTHOR

public static final int AUTHOR
The author of the module.

See Also:
Constant Field Values

VERSION

public static final int VERSION
The version of the module.

See Also:
Constant Field Values
Method Detail

enable

public boolean enable()
               throws Exception
Method to enable the module.

If it cannot enable the module because some other module is not enabled it can either return false or throw an exception. In that case the module loader will defer this attempt until all other modules are loaded (or until some more of ArgoUML is loaded if at startup). Eventually it is only this and some other modules that is not loaded and they will then be listed as having problems.

Returns:
true if all went well
Throws:
Exception - if there is a problem

disable

public boolean disable()
Method to disable the module.

If we cannot disable the module because some other module relies on it, we return false. This will then make it impossible to turn off. (An error is signalled at the attempt).

Returns:
true if all went well.

getName

public String getName()
The name of the module.

This should be a short string. For the purpose of having the GUI that turns on and off the module look nice there is no whitespace in this string (no spaces, tabs or newlines).

This name is also used as the key internally when modules checks for other modules, if they are available.

Returns:
the name (A String).

getInfo

public String getInfo(int type)
The info about the module.

This returns texts with information about the module.

The possible informations are retrieved by giving any of the arguments:

If a module does not provide a specific piece of information, null can be returned. Hence the normal implementation should be:
 public String getInfo(int type) {
     switch (type) {
     case DESCRIPTION:
         return "This module does ...";
     case AUTHOR:
         return "Annie Coder";
     default:
         return null;
 }
 

Parameters:
type - The type of information.
Returns:
The description. A String.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook