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 SummaryConstructors Constructor Description PluginScannerExample()
- 
Method SummaryModifier and Type Method Description voidbuildHierarchicalMenuFromClasses()java.util.VectorgetFoundInstrumentList()voidhierarchicalMenuItemSelected(PVMenu topMenu, java.lang.String hierarchicalName)static voidmain(java.lang.String[] args)java.lang.StringscanForClasses(java.util.Vector searchPaths)Methods inherited from class com.softsynth.jmsl.view.PVFrameAdapteradd, 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, validateMethods inherited from class java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait
- 
Constructor Details- 
PluginScannerExamplepublic PluginScannerExample()
 
- 
- 
Method Details- 
buildHierarchicalMenuFromClassespublic void buildHierarchicalMenuFromClasses()
- 
scanForClassespublic 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:
- hierarchicalMenuItemSelectedin interface- HierarchicalMenuListener
 
- 
getFoundInstrumentListpublic java.util.Vector getFoundInstrumentList()- Returns:
- Returns the foundInstrumentList.
 
- 
mainpublic static void main(java.lang.String[] args)
 
-