Package jmslexamples
Class PluginScannerExample
java.lang.Object
com.softsynth.jmsl.view.PVFrameAdapter
jmslexamples.PluginScannerExample
- All Implemented Interfaces:
PVComponent
,PVFrame
,HierarchicalMenuListener
public class PluginScannerExample extends PVFrameAdapter implements HierarchicalMenuListener
Scans a folder named "jmsl_plugins" which must be in the CLASSPATH.
Searches for classes implementing the Instrument interface.
Prints a list of found classes to the console.
Builds a HierarchicalMenu from the found classes.
Select an item from the HierarchicalMenu and get notified of the fully qualified classname.
This can be used to instantiate an instance of the selected item.
The design of this example is at the heart of the JMSL plugins model.
Searches for classes implementing the Instrument interface.
Prints a list of found classes to the console.
Builds a HierarchicalMenu from the found classes.
Select an item from the HierarchicalMenu and get notified of the fully qualified classname.
This can be used to instantiate an instance of the selected item.
The design of this example is at the heart of the JMSL plugins model.
- Author:
- Nick Didkovsky, (c) 2004 All rights reserved, Email: nick@didkovsky.com
-
Constructor Summary
Constructors Constructor Description PluginScannerExample()
-
Method Summary
Modifier and Type Method Description void
buildHierarchicalMenuFromClasses()
java.util.Vector
getFoundInstrumentList()
void
hierarchicalMenuItemSelected(PVMenu topMenu, java.lang.String hierarchicalName)
static void
main(java.lang.String[] args)
java.lang.String
scanForClasses(java.util.Vector searchPaths)
Methods inherited from class com.softsynth.jmsl.view.PVFrameAdapter
add, add, addKeyListener, addWindowListener, dispose, equals, getBackground, getBounds, getComponent, getFont, getFontMetrics, getLocation, getParent, getPVMenuBar, hashCode, isEnabled, isShowing, pack, removeAll, removeKeyListener, setBackground, setEnabled, setFont, setFrameLayout, setLocation, setPVMenuBar, setResizable, setSize, setSize, setTitle, setVisible, toBack, toFront, toString, validate
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
PluginScannerExample
public PluginScannerExample()
-
-
Method Details
-
buildHierarchicalMenuFromClasses
public void buildHierarchicalMenuFromClasses() -
scanForClasses
public java.lang.String scanForClasses(java.util.Vector searchPaths) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.io.IOException- Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.io.IOException
-
hierarchicalMenuItemSelected
- Specified by:
hierarchicalMenuItemSelected
in interfaceHierarchicalMenuListener
-
getFoundInstrumentList
public java.util.Vector getFoundInstrumentList()- Returns:
- Returns the foundInstrumentList.
-
main
public static void main(java.lang.String[] args)
-