|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.pluglets.PlugletLoader
public class PlugletLoader
PlugletLoader
Generates a vector of objects that are a subclass of a given class.
These objects must have a no-arg constructor and be in a given directory.
If a serious error occurs (no such directory, can't read directory, no
files) the vector will be null. Otherwise, individual classes are skipped.
Current implementation prints status and error/exception information
to stdout.
There is, at this time, little support for JarFiles or subdirectories.
Field Summary | |
---|---|
protected static Category |
cat
|
protected Vector<Pluglet> |
pluglets
Vector of pluglets that have been successfully loaded. |
Constructor Summary | |
---|---|
protected |
PlugletLoader()
|
|
PlugletLoader(String baseClassName,
String directory)
Creates a new PlugletLoader instance. |
Method Summary | |
---|---|
void |
addToAnswerEventProducer(AnswerEventProducer cont)
Deprecated. This should be in FeedbackPluglet |
void |
addToContainer(Container cont)
Add each of my pluglets that are a subclass of java.awt.Component, to the given java.awt.Container. |
void |
addToJMenuAsCheckboxes(JMenu menu)
Given a JMenu, will add to it each loaded pluglet as a JCheckboxMenuItem. |
ButtonGroup |
addToJMenuAsRadioButtons(JMenu menu)
Given a JMenu, will add to it each loaded pluglet as a JRadioButtonMenuItem. |
Pluglet |
getPluginByName(String name)
Returns the named plugin if it exists, otherwise null. |
boolean |
isAJarFile(File f)
Returns true if the file is recognized as a Jar file. |
protected String |
mungeName(String in)
Returns the filename, sans extention, of a given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Vector<Pluglet> pluglets
protected static final Category cat
Constructor Detail |
---|
protected PlugletLoader()
public PlugletLoader(String baseClassName, String directory)
PlugletLoader
instance.
baseClassName
- a String
valuedirectory
- a String
valueMethod Detail |
---|
public void addToJMenuAsCheckboxes(JMenu menu)
menu
- a JMenu
valuepublic ButtonGroup addToJMenuAsRadioButtons(JMenu menu)
menu
- a JMenu
value
ButtonGroup
valuepublic void addToContainer(Container cont)
cont
- a Container
valuepublic Pluglet getPluginByName(String name)
name
- a String
value
Pluglet
value@Deprecated public void addToAnswerEventProducer(AnswerEventProducer cont)
addToAnswerEventProducer
method here.
cont
- an AnswerEventProducer
valueprotected String mungeName(String in)
in
- a String
value
String
valuepublic boolean isAJarFile(File f)
f
- a File
value
boolean
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |