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.
Author:
Nick Didkovsky, (c) 2004 All rights reserved, Email: nick@didkovsky.com
  • 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

      public void hierarchicalMenuItemSelected​(PVMenu topMenu, java.lang.String hierarchicalName)
      Specified by:
      hierarchicalMenuItemSelected in interface HierarchicalMenuListener
    • getFoundInstrumentList

      public java.util.Vector getFoundInstrumentList()
      Returns:
      Returns the foundInstrumentList.
    • main

      public static void main​(java.lang.String[] args)