public abstract class Extension extends Object implements Comparable<Extension>
Title: CASA Agent Infrastructure
Copyright: Copyright (c) 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Company: Knowledge Science Group, Department of Computer Science, University of Calgary
This class is the top-level class for various kinds of CASA extensions.Modifier and Type | Field and Description |
---|---|
static String |
ATTR_AGENTTYPE
This attribute contains a Class object of the most general agent class for which this extension object is applicable.
|
static String |
ATTR_AUTOLOAD
This attribute is true iff it this extension should be loaded automatically at startup.
|
static String |
ATTR_DOC
This attribute contains a short doc string to be used in dialogs, mouse-overs, etc
|
static String |
ATTR_EXTENSIONNAME
This attribute contains the name that will be used to refer to this extension in menus, etc.
|
static String |
ATTR_FRAMETYPE
The frame must be a object of this type (or it's subtypes)
|
protected ExtensionDescriptor |
descriptor
The object that contains a lot of the detail about this extension, including the ATTR_* attributes.
|
static String |
TYPE_CODE
The type name for a pure java code (from a jar) extension
|
static String |
TYPE_LISPSCRIPT
The type name for Lisp script extension; the file will be executed when the Tools|LispScript|[ATTR_EXTENSIONNAME] menu item is selected.
|
static String |
TYPE_TAB
The type name for a java code extension that will act as a tab pane in a
AbstractProcessWindow . |
Constructor and Description |
---|
Extension(ExtensionDescriptor d)
Every Extension object must have a descriptor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Extension o)
Defers to
ExtensionDescriptor.compareTo(ExtensionDescriptor) using descriptor |
(package private) abstract void |
load(AbstractInternalFrame frame,
AbstractProcess agent)
Initialize this extension.
|
String |
toString() |
(package private) int |
validate()
Validate the descriptor with respect to this extension.
|
protected int |
validateBool(String key,
Boolean defaultBool)
Utility method to validate a boolean attribute in the
descriptor |
protected int |
validateClass(String key,
Class defaultClass)
Utility method to validate a class attribute in the
descriptor |
protected int |
validateString(String key,
String defaultString)
Utility method to validate a String attribute in the
descriptor |
public static final String ATTR_AGENTTYPE
public static final String ATTR_FRAMETYPE
public static final String ATTR_AUTOLOAD
public static final String ATTR_EXTENSIONNAME
public static final String ATTR_DOC
public static final String TYPE_CODE
public static final String TYPE_TAB
AbstractProcessWindow
.public static final String TYPE_LISPSCRIPT
protected ExtensionDescriptor descriptor
public Extension(ExtensionDescriptor d)
d
- The descriptor for this extension.int validate() throws InvalidParameterException
This method:
AbstractProcess
.
AbstractInternalFrame
.
InvalidParameterException
- if a fatal error happens.protected int validateString(String key, String defaultString)
descriptor
key
- The key in the descriptor to validate.defaultString
- The default to assign to the key is it's value is missing.protected int validateBool(String key, Boolean defaultBool)
descriptor
key
- The key in the descriptor to validate.defaultBool
- The default to assign to the key is it's value is missing or otherwise invalid.protected int validateClass(String key, Class defaultClass)
descriptor
key
- The key in the descriptor to validate.defaultBool
- The default to assign to the key is it's value is missing or otherwise invalid.public String toString()
public int compareTo(Extension o)
ExtensionDescriptor.compareTo(ExtensionDescriptor)
using descriptor
compareTo
in interface Comparable<Extension>
abstract void load(AbstractInternalFrame frame, AbstractProcess agent)
frame
- The frame this extension should attach itself to. (May be null).agent
- The agent this extension should associate itself with. (May be null).